← Back to team overview

sikuli-driver team mailing list archive

[Question #676037]: JAVA API : hotkey working just first time?

 

New question #676037 on Sikuli:
https://answers.launchpad.net/sikuli/+question/676037

I'm trying to stop a loop in my app using a global hotkey .
This is the code for the hotkey I'm using:

        HotkeyListener hk_CTRL_F1 = new HotkeyListener()
        {
            @Override
            public void hotkeyPressed(HotkeyEvent e) {
                running=false;
            }
        };

        HotkeyManager.getInstance().addHotkey(Key.F1, KeyModifier.CTRL, hk_CTRL_F1 );

then in my loop I'ìm checking for running==true, else it should end.
I'm running my app from intellij IDEA ide, it works fine the fisrt time, then if I run it again the hotkey is not working anymore and the loop goes on forever.

if I close the IDE , repon and start it again , the hotkey works fine again (the first time).

I tried also to remove the hotkey after the loop, before closing the app like this:

HotkeyManager.getInstance().removeHotkey(Key.F1,KeyModifier.CTRL);

but this does not help.

Any idea? is it a bug?

thanks


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.