Code: Select all
$Numpad4::
$5::
!2::
$e::
Key := SubStr(A_ThisHotkey,0)
SetTimer, Send1, 100
Gosub, Send1
return
Numpad4 up::
!2 up::
5 up::
e up::
SetTimer, Send1, Off
return
Send1:
Send, {%Key%}
return
Would greatly appreciate any help
Code: Select all
$Numpad4::
$5::
!2::
$e::
Key := SubStr(A_ThisHotkey,0)
SetTimer, Send1, 100
Gosub, Send1
return
Numpad4 up::
!2 up::
5 up::
e up::
SetTimer, Send1, Off
return
Send1:
Send, {%Key%}
return
Yup holding it when theres numpad involved it doesn't send the numpad key but just the number and it just ignores any alt combination completelymikeyww wrote: ↑23 Sep 2022, 06:12Your script is designed so that the key must be held rather than pressed. Does it work in Notepad? Check the KeyHistory.
Code: Select all
VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.05 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h d 0.03 Numpad4
34 005 i d 0.00 4
34 005 i u 0.00 4
64 04B h u 0.02 Numpad4
If StartingPos is less than 1, it is considered to be an offset from the end of the string. For example, 0 extracts the last character and -1 extracts the two last characters.
Code: Select all
MsgBox, % SubStr("Numpad4", 0)
Code: Select all
!2 Up::
Send x
KeyWait, Alt
Send y
Return
Code: Select all
!2 Up::Send {Alt up}x
Code: Select all
MsgBox, % SubStr("Numpad4", -7)
Code: Select all
Key := SubStr(A_ThisHotkey ,-7)
Code: Select all
#UseHook
Numpad4::
5::
!2::
e::
key := RegExReplace(A_ThisHotkey, "[#^!+]")
SetKeyDelay, 100
While GetKeyState(key, "P")
Send {%key%}
Return
#UseHook Off