Use Func bind for Hotkey callback.

* Fixes issue with running with AHK after v1.1.29
This commit is contained in:
Andreas Reischuck 2019-03-17 23:35:31 +01:00 committed by qwertfisch
parent 1e2f61b796
commit b6996ca356
4 changed files with 22 additions and 30 deletions

View File

@ -126,8 +126,8 @@ CharProc__EHSu() {
global
; Space im Einhandmodus losgelassen
if (!EHKeyPressed) {
AllStar("*EHSpace")
AllStar("*EHSpace up")
AllStar("EHSpace", True, "*EHSpace")
AllStar("EHSpace", False, "*EHSpace up")
}
EHKeyPressed := 0
EHSpacePressed := 0

View File

@ -277,32 +277,35 @@ Comp := ""
RSC(sc,vk) {
global
vksc%sc% := "VK" . vk . "SC" . sc
RKEY(vksc%sc%)
RKEY(vk, vksc%sc%)
}
RSCN(sc,vk1,vk2) {
global
vkscn1%sc% := "VK" . vk1 . "SC" . sc
vkscn2%sc% := "VK" . vk2 . "SC" . sc
RKEY(vkscn1%sc%)
RKEY(vkscn2%sc%)
RKEY(vk1, vkscn1%sc%)
RKEY(vk2, vkscn2%sc%)
}
RKEY(key) {
RKEYN("*" . key)
RKEY(vk, key) {
vkey := "*VK" . vk
RKEYN(vkey, key)
}
RKEYS(keys) {
loop,parse,keys,`,
{
RKEY(A_Loopfield)
RKEYN("*" . A_Loopfield, A_Loopfield)
}
}
RKEYN(dnkey) {
RKEYN(dnkey, key) {
upkey := dnkey . " up"
Hotkey,% dnkey,allstarhook
Hotkey,% upkey,allstarhook
upfn := Func("AllStar").Bind(key, False, upkey)
dnfn := Func("AllStar").Bind(key, True, dnkey)
Hotkey,% dnkey,% dnfn
Hotkey,% upkey,% upfn
}
Layout00000407() {
@ -380,9 +383,9 @@ Layout00000407() {
RKEYS("space,enter,backspace")
RKEYS("del,ins,home,end,pgup,pgdn,up,down,left,right")
; Diverses ohne *
RKEYN("tab")
RKEYN("esc")
RKEYN("numpadenter")
RKEYN("tab", "tab")
RKEYN("esc", "esc")
RKEYN("numpadenter", "numpadenter")
; Modifier
RSC("02A","A0") ; M2L
RSC("136","A1") ; M2R
@ -593,9 +596,9 @@ Layout00000807() {
RKEYS("space,enter,backspace")
RKEYS("del,ins,home,end,pgup,pgdn,up,down,left,right")
; Diverses ohne *
RKEYN("tab")
RKEYN("esc")
RKEYN("numpadenter")
RKEYN("tab", "tab")
RKEYN("esc", "esc")
RKEYN("numpadenter", "numpadenter")
; Modifier
RSC("02A","A0") ; M2L
RSC("136","A1") ; M2R

View File

@ -11,10 +11,6 @@ Suspend, Permit
Traytogglesuspend()
return
allstarhook:
AllStar(A_ThisHotkey)
return
; Ein paar andere Hooks kommen hier auch noch. GUIs springen hier her, wenn
; sich bei ihnen etwas auf die entsprechende Art tut.

View File

@ -2,16 +2,9 @@
#NoEnv
AllStar(This_HotKey) {
AllStar(KeyId, IsDown, This_HotKey) {
global
PhysKey := This_HotKey
if (SubStr(PhysKey,1,1) == "*")
PhysKey := SubStr(PhysKey,2)
if (SubStr(PhysKey,-2) == " up") {
PhysKey := SubStr(PhysKey,1,StrLen(PhysKey)-3)
IsDown := 0
} else
IsDown := 1
PhysKey := KeyId
if (TransformProc != "")
ActKey := Transform%TransformProc%(PhysKey)
else