#Separate Keyboard Shortcuts For Every Window

3 messages · Page 1 of 1 (latest)

tepid elk
#

Basically I have a JavaFX app with main window that eventually creates other JFrames. In my Application subclass I register a JNativeHook so I receive keyboard input, but I want to perform actions upon it only in the window/frame that has focus/is on the top.

Currently I am using focus events and store a static hasFocusedInstance on each window's class, but it does not seem to work 100%. Is there a good way to do this? I do not wanna use KeyBinds/KeyEventListeners for they are unreliable.

neon zephyrBOT
#

This post has been reserved for your question.

Hey @tepid elk! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.