How can I resolve a focus issue in Slate?
hoping there's someone out there that can point me in the right direction - I've been fighting with this for a while now and it's driving me up a wall.
Here's the issue:
I have a game, with ESC bound to toggle an in-game menu and at the same time pause the game. That works excellently, and I can hit ESC while the menu is up to toggle the menu again and unpause the game (I've got a OnKeyDown event handler in the slate widget taking care of that.
Now here's the rub: If I click anywhere within the window with the mouse while the game is paused and the menu is up, I seem to lose focus on the widget and the ESC press is no longer caught in the OnKeyDown handler.
I've tried hooking up handlers for OnKeyboardFocusLost, OnKeyboardFocusReceived and OnKeyboardFocusChanging but that didn't get me much further as far as trying to force focus to stay on the slate widget.
Can anyone give me any pointers as to how I should approach this, or maybe even check globally for that keypress instead of just inside this specific widget?
Thanks in advance!
It's a bit heavy handed but you could try using OnPreviewKeyDown, however if your menu is losing focus I'm not sure that would help.
answered Apr 24 '14 at 08:58 PM
Jamie Dale STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here