浏览代码

Fixed 3807

Tig 10 月之前
父节点
当前提交
adb917c5c8
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

+ 11 - 0
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -1725,6 +1725,17 @@ internal class WindowsDriver : ConsoleDriver
                 }
             }
 
+            // If KeyInfo.Key is A...Z and KeyInfo.KeyChar is not a...z then we have an accent.
+            // See https://github.com/gui-cs/Terminal.Gui/issues/3807#issuecomment-2455997595
+            if (keyInfo.KeyChar <= (char)'z')
+            {
+                return (KeyCode)keyInfo.Key;
+            }
+            else
+            {
+                return (KeyCode)keyInfo.KeyChar;
+            }
+
             // Return the Key (not KeyChar!)
             return (KeyCode)keyInfo.Key;
         }