06-13-2014, 02:10 AM
Is it possible to register multiple hotkeys dynamically based on an array for example.
The code I have now is to much to post here, so I extracted the parts which should matter.
It is like this:
Macro Macro25
edit: array size can vary
I think "hk" can be used for one hotkey? So if 'hk' has "F1" I can not use 'hk' again even if I use a different hotkey id.
with hotkey Id i mean:
function! hWnd hkId mod vk
Is it possible in another way?
EDIT:
I think I got the correct method, I did the "__RegisterHotKey- hk" decleration outside the for loop and I declared it thread global (minus sign). All the keys are now getting registered and seem to work.
The code I have now is to much to post here, so I extracted the parts which should matter.
It is like this:
Macro Macro25
ARRAY(int) all_keys
int i
;.
;.
;.
;array get's filled
;.
;.
;.
all_keys[0]=562
all_keys[1]=564
all_keys[2]=567
for i 0 all_keys.len ;; i also corresponds to hotkey ID
,__RegisterHotKey hk.Register(hDlg i 0 all_keys[i]) ;;all hotkeys don't have mod
;; only first ID (0) get's correctly registered and works, others do not get registered.
edit: array size can vary
I think "hk" can be used for one hotkey? So if 'hk' has "F1" I can not use 'hk' again even if I use a different hotkey id.
with hotkey Id i mean:
function! hWnd hkId mod vk
Is it possible in another way?
EDIT:
I think I got the correct method, I did the "__RegisterHotKey- hk" decleration outside the for loop and I declared it thread global (minus sign). All the keys are now getting registered and seem to work.