03-09-2017, 11:43 AM
Dear Gintaras,
Many thanks for your advice. Having taken into consideration topic
Detecting shift with wait for key
I came up with the following workaround, which it works.
Function monitor_input_hook
I would appreciate any advice/suggestion to improve this code.
Furthermore, I am wondering whether there exists an easy way to convert the "SHIFT+..." output to its equivalent character. For example to get "$" instead of Shift+4.
Many thanks in advance.
Many thanks for your advice. Having taken into consideration topic
Detecting shift with wait for key
I came up with the following workaround, which it works.
Function monitor_input_hook
function nCode wParam KBDLLHOOKSTRUCT&h
if(getopt(nargs)=0)
,if(getopt(nthreads)>1) ret
,int- t_keyhook
,t_keyhook=SetWindowsHookEx(WH_KEYBOARD_LL &monitor_input_hook _hinst 0)
,MessageLoop
,ret
;debug
;FormatKeyString h.vkCode 0 &_s
;out "%s %s%s" _s iif(h.flags&LLKHF_UP "up" "down") iif(h.flags&LLKHF_INJECTED ", injected" "")
int- shm
if h.vkCode=160 or h.vkCode=161
,shm=iif(h.flags&LLKHF_UP 0 1)
;,out F"Shift {shm}"
else
;,out F"Character {h.vkCode} : {shm} - {h.flags&LLKHF_UP}"
,if h.flags&LLKHF_UP
;,,out F"Character {h.vkCode} : {shm} - {h.flags&LLKHF_UP}"
,,FormatKeyString h.vkCode shm &_s
,,out _s
,,
ret CallNextHookEx(t_keyhook nCode wParam &h)I would appreciate any advice/suggestion to improve this code.
Furthermore, I am wondering whether there exists an easy way to convert the "SHIFT+..." output to its equivalent character. For example to get "$" instead of Shift+4.
Many thanks in advance.
