summaryrefslogtreecommitdiff
path: root/windows/neo-vars
diff options
context:
space:
mode:
authorPhilip Zander <philip.zander@gmail.com>2019-08-19 23:12:36 +0200
committerqwertfisch <develop-github@qwertfisch.eu>2019-08-21 19:37:12 +0200
commit3c19ca30fb4fbcb201366a7e40f107b12c7221a7 (patch)
tree78fe6e750211cfae5724727fd09852feb898d93c /windows/neo-vars
parentfdb34f295eefc788ab61b613681339c8aaa8b30a (diff)
downloadneo-layout-3c19ca30fb4fbcb201366a7e40f107b12c7221a7.tar.gz
neo-layout-3c19ca30fb4fbcb201366a7e40f107b12c7221a7.tar.bz2
neo-layout-3c19ca30fb4fbcb201366a7e40f107b12c7221a7.zip
Remove obsolete GTK hack
Diffstat (limited to 'windows/neo-vars')
-rw-r--r--windows/neo-vars/src/source/varsfunctions.ahk111
1 files changed, 47 insertions, 64 deletions
diff --git a/windows/neo-vars/src/source/varsfunctions.ahk b/windows/neo-vars/src/source/varsfunctions.ahk
index 8cc3463..a6e2f53 100644
--- a/windows/neo-vars/src/source/varsfunctions.ahk
+++ b/windows/neo-vars/src/source/varsfunctions.ahk
@@ -363,81 +363,64 @@ CharProc__M4RU() {
}
SendUnicodeChar(charCode){
- IfWinActive,ahk_class gdkWindowToplevel
- {
- StringLower,charCode,charCode
- send % "^+u" . SubStr(charCode,3) . " "
+ static ki := "#"
+ if (ki =="#") {
+ VarSetCapacity(ki,28*4,0)
+ DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
+ DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
+ DllCall("RtlFillMemory","uint",&ki+2*28+0,"uint",1,"uint",1)
+ DllCall("RtlFillMemory","uint",&ki+3*28+0,"uint",1,"uint",1)
+ }
+ if (charCode < 0x10000) {
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|charCode) ;KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+28+6,"uint",4,"uint",0x60000|charCode) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
} else {
- static ki := "#"
- if (ki =="#") {
- VarSetCapacity(ki,28*4,0)
- DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
- DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
- DllCall("RtlFillMemory","uint",&ki+2*28+0,"uint",1,"uint",1)
- DllCall("RtlFillMemory","uint",&ki+3*28+0,"uint",1,"uint",1)
- }
- if (charCode < 0x10000) {
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|charCode) ;KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+28+6,"uint",4,"uint",0x60000|charCode) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
- } else {
- hi_surrogate := 0xD800|((charCode-0x10000)/1024)
- lo_surrogate := 0xDC00|((charCode-0x10000)&0x3FF)
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|hi_surrogate) ;KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x40000|lo_surrogate) ;KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+2*28+6,"uint",4,"uint",0x60000|hi_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+3*28+6,"uint",4,"uint",0x60000|lo_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",4,"UInt",&ki,"Int",28)
- }
+ hi_surrogate := 0xD800|((charCode-0x10000)/1024)
+ lo_surrogate := 0xDC00|((charCode-0x10000)&0x3FF)
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|hi_surrogate) ;KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x40000|lo_surrogate) ;KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+2*28+6,"uint",4,"uint",0x60000|hi_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+3*28+6,"uint",4,"uint",0x60000|lo_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",4,"UInt",&ki,"Int",28)
}
}
SendUnicodeCharDown(charCode){
- IfWinActive,ahk_class gdkWindowToplevel
- {
- StringLower,charCode,charCode
- send % "^+u" . SubStr(charCode,3) . " "
+ static ki := "#"
+ if (ki =="#") {
+ VarSetCapacity(ki,28*2,0)
+ DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
+ DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
+ }
+ if (charCode < 0x10000) {
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|charCode) ;KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",1,"UInt",&ki,"Int",28)
} else {
- static ki := "#"
- if (ki =="#") {
- VarSetCapacity(ki,28*2,0)
- DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
- DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
- }
- if (charCode < 0x10000) {
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|charCode) ;KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",1,"UInt",&ki,"Int",28)
- } else {
- hi_surrogate := 0xD800|((charCode-0x10000)/1024)
- lo_surrogate := 0xDC00|((charCode-0x10000) & 0x3FF)
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|hi_surrogate) ;KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x40000|lo_surrogate) ;KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
- }
+ hi_surrogate := 0xD800|((charCode-0x10000)/1024)
+ lo_surrogate := 0xDC00|((charCode-0x10000) & 0x3FF)
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x40000|hi_surrogate) ;KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x40000|lo_surrogate) ;KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
}
}
SendUnicodeCharUp(charCode){
- IfWinActive,ahk_class gdkWindowToplevel
- {
- ; nothing
+ static ki := "#"
+ if (ki =="#") {
+ VarSetCapacity(ki,28*2,0)
+ DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
+ DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
+ }
+ if (charCode < 0x10000) {
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x60000|charCode) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",1,"UInt",&ki,"Int",28)
} else {
- static ki := "#"
- if (ki =="#") {
- VarSetCapacity(ki,28*2,0)
- DllCall("RtlFillMemory","uint",&ki+ 0,"uint",1,"uint",1)
- DllCall("RtlFillMemory","uint",&ki+ 28+0,"uint",1,"uint",1)
- }
- if (charCode < 0x10000) {
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x60000|charCode) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",1,"UInt",&ki,"Int",28)
- } else {
- hi_surrogate := 0xD800|((charCode-0x10000)/1024)
- lo_surrogate := 0xDC00|((charCode-0x10000)&0x3FF)
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x60000|hi_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x60000|lo_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
- DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
- }
+ hi_surrogate := 0xD800|((charCode-0x10000)/1024)
+ lo_surrogate := 0xDC00|((charCode-0x10000)&0x3FF)
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 6,"uint",4,"uint",0x60000|hi_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("ntdll.dll\RtlFillMemoryUlong","uint",&ki+ 28+6,"uint",4,"uint",0x60000|lo_surrogate) ;KEYEVENTF_KEYUP|KEYEVENTF_UNICODE
+ DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
}
}