You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original report by Dave Tarkowski (Bitbucket: David Tarkowski).
When I add a KeyEventDispatcherhandler, the behavior is different between Windows and Mac, specifically, I think that the Mac version is wrong.
I’ve attached a set of files which modify the detailed test. The changes include the following:
In MainFrame.java, add a KeyEventDispatcher which does the following:
Print a message
Sleep for 100ms
Print out another message
Return true to indicate that any further key event processing should be cancelled.
In handler/KeyboardHandler.java add an onPreKeyEvent handler which prints a message showing when the onPreKeyEvent is fired.
When running that code I observe the following:
On Windows, the KeyEventDispatcher is never fired when the focus is in the browser window. If it is in a pure Java component, like the address bar, it is fired and behaves as normal.
On Mac, when the focus is in the browser, the KeyEventDispatcher is not fired for normal key events, but it is for events that use modifiers such as CTRL and CMD, for example, Ctrl+Shift+a.
On Mac, while the KeyEventDispatcher is sleeping, the onPreKeyEvent is fired. If the KeyEventDispatcher is being fired, it should be allowed to process the key event before being passed on to any other components.
I’m not sure if the Windows behavior is correct, but I am okay with it.
The big problem on the Mac is that the KeyEventDispatcher is not allowed to swallow the processing when it is fired.
The text was updated successfully, but these errors were encountered:
Original report by Dave Tarkowski (Bitbucket: David Tarkowski).
When I add a
KeyEventDispatcher
handler, the behavior is different between Windows and Mac, specifically, I think that the Mac version is wrong.I’ve attached a set of files which modify the detailed test. The changes include the following:
In MainFrame.java, add a KeyEventDispatcher which does the following:
In handler/KeyboardHandler.java add an onPreKeyEvent handler which prints a message showing when the onPreKeyEvent is fired.
When running that code I observe the following:
I’m not sure if the Windows behavior is correct, but I am okay with it.
The big problem on the Mac is that the KeyEventDispatcher is not allowed to swallow the processing when it is fired.
The text was updated successfully, but these errors were encountered: