Restrict button press from being sent to daw

I was planning on letting users input arrow keys to navigate my plugin but realized that the left/right arrows trigger an action in the daw.

I suppose it would be horrible to disable daw functionality (and I doubt it is possible)… but is there any way for me to be able to use right/left arrows without triggering the daw?

Specifically, in fl studio they change the view mode of the active plugin.

If your Component(s) accept keyboard focus, then you should be able to get those keystrokes, but you’ll have to click someplace on your plugin GUI in most cases first (depending on the host), to transfer keyboard focus to it. And then to give focus back to the host, you’ll have to click on one of its windows. Not the most elegant design, but DAWs in general prefer to have key strokes go to them, not to the plugins.

We generally call setWantsKeyboardFocus(false) on most of our controls and Component views, only allowing things that expect focus to maintain that paradigm (such as Labels that we allow to be edited), just to prevent having to click back on the host to get focus back to it.

I wouldn’t rely too much on this though -maybe as a secondary option, but always with a mouse fallback. I’ve got many times in Cubase to a point where it doesn’t release the focus anymore until you restart the program. I think something similar happens with Live.

damn, good to know, thanks.