How do you detect if the user is holding down the start key? Protools uses this for some shortcuts and I want to be able to detect it’s pushed …
I’m new to JUCE so apologies if this isn’t what you’re looking for. It should work in C++ Windows programs though.
GetKeyState can be used to tell you if a “virtual key” is being pressed.
When you say start key, do you mean the “Windows key”? If so, there are apparently two you’ll have to check:
- VK_LWIN (0x5B) - Left Windows key (Natural keyboard)
- VK_RWIN (0x5C) - Right Windows key (Natural keyboard)
Hope that helps!
Shane
This might well be what I need
Jules - is there a reason the windows specific modifier keys arent’ available in ModifierKeys? You’ve got to deal with some platform specifics there anyway …
A good question imho! The PT automation dialog specifically asks for a Windows Key modifier to be implemented (further, the PT specific key strokes, different for Mac and Win, should block click propagation at Component level).
In Pro Tools you have to rely on the modifier keys passed by GetViewContainer()->GetModifiers()
as Pro Tools won’t pass the Windows key to plugins (as far as I remember).
would be nice to add Start
/ Win
key eventually to JUCE
I’ve ended up pushing this to the SR-JUCE
branch:
To maintain compatibility, it adds a new check for the test flag instead of ‘fixing’ thus breaking the Command
check that translates to Ctrl on Windows.
Tested on Windows, Ubuntu.