I use the following command to lock a keystroke to a function
Code:
on_2 = freeCamera;
How do I trap an extended keystroke combination like ctrl-a or alt-c? I know how to check for it but can't see how to use it like above. Any help is greatly appreciated.
function that_shall_be_run_when_alt_and_c_is_pressed () { ... }
function that_shall_be_run_when_only_c_is_pressed () { ... } function that_shall_be_run_when_c_is_pressed () { if (key_alt) that_shall_be_run_when_alt_and_c_is_pressed (); else function that_shall_be_run_when_only_c_is_pressed (); }
Hmm, yes, but on_c will also be executed when prssing alt+c. Also, usually you have to hold alt first and then press c for executing the function, yours also allowes first pressing c and then pressing alt.