summaryrefslogtreecommitdiffstats
path: root/windows/autohotkey/Source/Methods-Other.ahk
diff options
context:
space:
mode:
authordennis <dennis@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-07-23 22:56:34 +0000
committerdennis <dennis@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-07-23 22:56:34 +0000
commitb3d67677d7f247608e8b46780e3b0322caccbd66 (patch)
treec6708642bedad4ca48d0b92a2af578b3fdf35fa4 /windows/autohotkey/Source/Methods-Other.ahk
parentc91ca6c6cfeba18df75492a7309610393ebb3d9b (diff)
Die SendUnicodeChar-Methode um den GDK-Workarround von Matthias Wächter ergänzt.
git-svn-id: https://svn.neo-layout.org@687 b9310e46-f624-0410-8ea1-cfbb3a30dc96
Diffstat (limited to 'windows/autohotkey/Source/Methods-Other.ahk')
-rw-r--r--windows/autohotkey/Source/Methods-Other.ahk31
1 files changed, 22 insertions, 9 deletions
diff --git a/windows/autohotkey/Source/Methods-Other.ahk b/windows/autohotkey/Source/Methods-Other.ahk
index b937080..8021ad1 100644
--- a/windows/autohotkey/Source/Methods-Other.ahk
+++ b/windows/autohotkey/Source/Methods-Other.ahk
@@ -164,17 +164,30 @@ IsModifierPressed()
SendUnicodeChar(charCode)
{
- VarSetCapacity(ki, 28 * 2, 0)
+ IfWinActive, ahk_class gdkWindowToplevel
+ {
+ StringLower, charCode, charCode
+ send "^+u" . SubStr(charCode,3) . " "
+ } else {
+ VarSetCapacity(ki, 28 * 2, 0)
+
+ EncodeInteger(&ki + 0, 1)
+ EncodeInteger(&ki + 6, charCode)
+ EncodeInteger(&ki + 8, 4)
+ EncodeInteger(&ki +28, 1)
+ EncodeInteger(&ki +34, charCode)
+ EncodeInteger(&ki +36, 4|2)
+
+ DllCall("SendInput", "UInt", 2, "UInt", &ki, "Int", 28)
+ }
+}
+/*
+Über den GDK-Workarround:
+Dieser basiert auf http://www.autohotkey.com/forum/topic32947.html
- EncodeInteger(&ki + 0, 1)
- EncodeInteger(&ki + 6, charCode)
- EncodeInteger(&ki + 8, 4)
- EncodeInteger(&ki +28, 1)
- EncodeInteger(&ki +34, charCode)
- EncodeInteger(&ki +36, 4|2)
+Der Aufruf von »SubStr(charCode,3)« geht davon aus, dass alle charCodes in Hex mit führendem „0x“ angegeben sind. Die abenteuerliche „^+u“-Konstruktion benötigt im Übrigen den Hex-Wert in Kleinschrift, was derzeit nicht bei den Zeichendefinitionen umgesetzt ist, daher zentral und weniger fehlerträchtig an dieser Stelle. Außerdem ein abschließend gesendetes Space, sonst bleibt der „eingetippte“ Unicode-Wert noch kurz sichtbar stehen, bevor er sich GTK-sei-dank in das gewünschte Zeichen verwandelt.
+*/
- DllCall("SendInput", "UInt", 2, "UInt", &ki, "Int", 28)
-}
BSSendUnicodeChar(charCode)
{