diff --git a/Tiefsee/StartWindow.cs b/Tiefsee/StartWindow.cs index 9310fa2..d4d0c0a 100644 --- a/Tiefsee/StartWindow.cs +++ b/Tiefsee/StartWindow.cs @@ -76,7 +76,15 @@ private void InitQuickLook() { Adapter.LoopRun(50, () => { bool isKeyboardSpace = Keyboard.IsKeyDown(Key.Space); // 按著空白鍵 - bool isMouseMiddle = System.Windows.Forms.Control.MouseButtons == System.Windows.Forms.MouseButtons.Middle; //按著滑鼠滾輪 + + // 避免與切換輸入法的快速鍵衝突 + if (isDown == false && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl) || + Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift) || + Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt))) { + isKeyboardSpace = false; + } + + bool isMouseMiddle = Control.MouseButtons == MouseButtons.Middle; // 按著滑鼠滾輪 int quickLookRunType = 0; if (isKeyboardSpace) { quickLookRunType = 1; } diff --git a/Tiefsee/VW/WV_System.cs b/Tiefsee/VW/WV_System.cs index 64321a4..3b7133d 100644 --- a/Tiefsee/VW/WV_System.cs +++ b/Tiefsee/VW/WV_System.cs @@ -78,14 +78,10 @@ public async Task SetTiefseTask(bool val) { /// 取得當前是否按著空白鍵跟滑鼠滾輪 /// public string GetDownKey() { - bool isKeyboardSpace = Keyboard.IsKeyDown(Key.Space); // 按著空白鍵 - bool isMouseMiddle = System.Windows.Forms.Control.MouseButtons == System.Windows.Forms.MouseButtons.Middle; // 按著滑鼠滾輪 - var obj = new { - isKeyboardSpace = isKeyboardSpace, - isMouseMiddle = isMouseMiddle + isKeyboardSpace = Keyboard.IsKeyDown(Key.Space), // 按著空白鍵 + isMouseMiddle = Control.MouseButtons == MouseButtons.Middle, // 按著滑鼠滾輪 }; - return JsonSerializer.Serialize(obj); }