Quote:
Originally Posted by Meo-Ada Mespotine
I have a question about intercepting keyboard-messages.
I have this script which opens its own gui-window and I would like to pass all keys through to the Reaper-window except the Enter, ESC and Space-key.
So my script would react to Enter, ESC and Space, where all other keys are redirected to, let's say, the arrangeview, so running all other actions associated with the other keys are still runnable.
Now here's my problem: how can I do that?
Code:
gfx.init()
function main()
Key=gfx.getchar()
if Key~=-1 and Key~=13 and Key~=27 and Key~=32 then
-- What do I need to write in this if-branch?
reaper.ClearConsole()
reaper.ShowConsoleMsg("This Key is sent to the Arrangeview")
else
reaper.ClearConsole()
reaper.ShowConsoleMsg("This Key is treated in gfx-window and not sent to Arrangeview")
end
reaper.defer(main)
end
main()
|
Not at the computer right now, but you would use
https://www.extremraym.com/cloud/rea...VKeys_GetState to get the current key state and compare it with the desired values.
Edit, sorry, of course you also need to intercept the keys:
https://www.extremraym.com/cloud/rea...Keys_Intercept