Key-pressed code not working

Hi,
I’m having some strange behavior in my application.
I have created a custom login screen, with key-pressed event for TAB and Enter key.
This works fine as long as I have the menu-bar and window menu activated in the client.
But if I disable these, none of the key-pressed events are working.

Running Windows 7 and Ignition 7.9.4

Key-pressed events only go to the component that has the focus. When the menu is active, the window itself has the focus, so you get the events on the window.
What you really want is a key binding, which I believe you’ll have to construct and activate manually. Good luck!

1 Like

Complicating things further, I’m pretty sure tab and enter are both treated differently by swing because they’re part of the focus traversal system - so you’ll probably have to remove their default actions, then implement Phil’s suggestion.

1 Like

Don’t know if this will work for you but you can try requesting focus for some component on that screen and then continue with your key pressed event. Script below is on the internalFrameActivated event of a window.

component = system.gui.getParentWindow(event).getComponentForPath('Root Container.Button')
component.requestFocusInWindow()