← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #262454]: Registred hotkeys causes java crash on mac

 

Question #262454 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/262454

    Status: Open => Answered

RaiMan proposed the following answer:
Just checked with my OS X 10.10.2 and version 1.1.0-Jan-15:

public class TestRun {

  static Screen s = new Screen();
  static boolean shouldExit = false;

  private static void p(String msg, Object... args) {
    System.out.println(String.format(msg, args));
  }
  
  private static void terminate(int retVal, String msg, Object... args ) {
    p(msg, args);
    System.exit(retVal);
  }

  public static void main(String[] args) throws FindFailed, IOException
{

    Debug.on(3);
    
    HotkeyManager.getInstance()._addHotkey(KeyEvent.VK_2, KeyEvent.SHIFT_MASK + KeyEvent.CTRL_MASK, new HotkeyListener() {
          @Override
          public void hotkeyPressed(HotkeyEvent e) {
            p("hotkey pressed");
            shouldExit = true;
          }
    });
    
    while (!shouldExit) {
      s.wait(1f);
    }

  }

and this worked as expected (run from within Netbeans).

So I guess, you have to look deeper into your plugin implementation or
Eclipse about conflicts using the Mac hotkey features used in the Sikuli
dylib.

the sources on GitHub
https://github.com/RaiMan/SikuliX-2014/StuffContainer/LibsBuild/src_org/main/java/native/Hotkey/Mac

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.