View Single Post
Old 01-29-2020, 05:53 AM   #933
Human being with feelings
amagalma's Avatar
Join Date: Apr 2011
Posts: 2,171

Originally Posted by Edgemeal View Post
Think you need to use a virtual key code,

so something like,
VK_O = 0x4F -- 'O' key
... :byte(VK_O) ~= 0 then ...

Thank you Edgemeal!!

Another question:

How can I know what key triggered the current script so that I can check if it is still being held down? For example I have set my script to work with mousewheel+Alt+Shift and have hard-coded in the script to check if Alt+Shift are being held (as julian showed me):
if reaper.JS_Mouse_GetState(24) == 24 then ... -- 8:Shift, 16:Alt
How could my script know the modifiers that triggered it without hard-coding it inside?
modifiers_that_triggered_script = xxxx
if reaper.JS_Mouse_GetState(modifiers_that_triggered_script ) == modifiers_that_triggered_script then

Last edited by amagalma; 01-29-2020 at 06:05 AM.
amagalma is offline   Reply With Quote