summaryrefslogtreecommitdiffstats
path: root/windows/autohotkey/Source/Methods-Unicode.ahk
diff options
context:
space:
mode:
authormartin_r <martin_r@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-08-18 19:25:20 +0000
committermartin_r <martin_r@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-08-18 19:25:20 +0000
commitc63134e1ac0522b643dffd4c71bcff2b27eab30d (patch)
treea016dc31193ff9e157f4a1502dee0f56a5ffc290 /windows/autohotkey/Source/Methods-Unicode.ahk
parentfeb93d6b8ae1a59d0fbe479409906ad6a8f74620 (diff)
Modularisierung des AHK konsequent weitergeführt.
neo20.txt: Ebenen 7 und 8 ergänzt, Ebenen 2 und 4 des Numpads vertauscht. Methods-Layers.ahk: Mod3-Lock abgeschafft, CapsLock neu geschrieben. + Viele kleine Änderungen. git-svn-id: https://svn.neo-layout.org@776 b9310e46-f624-0410-8ea1-cfbb3a30dc96
Diffstat (limited to 'windows/autohotkey/Source/Methods-Unicode.ahk')
-rw-r--r--windows/autohotkey/Source/Methods-Unicode.ahk29
1 files changed, 29 insertions, 0 deletions
diff --git a/windows/autohotkey/Source/Methods-Unicode.ahk b/windows/autohotkey/Source/Methods-Unicode.ahk
index 00a5ba5..227bedf 100644
--- a/windows/autohotkey/Source/Methods-Unicode.ahk
+++ b/windows/autohotkey/Source/Methods-Unicode.ahk
@@ -32,5 +32,34 @@ BSUnicode(code)
Neuer Weg – Benutzung der entsprechenden Win32-API-Methode
************************************************************/
+/*
+Über den GTK-Workaround:
+Dieser basiert auf http://www.autohotkey.com/forum/topic32947.html
+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.
+*/
+
+SendUnicodeChar(charCode)
+{
+ 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)
+ }
+}
+
+EncodeInteger(ref, val)
+{
+ DllCall("ntdll\RtlFillMemoryUlong", "Uint", ref, "Uint", 4, "Uint", val)
+}