JIntellitypeTester.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:PhET 作者:
/**
 * Method to register a hotkey using the RegisterHotKey Windows API call.
 * <p>
 * @param aEvent the ActionEvent fired.
 */
private void btnRegisterHotKey_actionPerformed(ActionEvent aEvent) {
   // assign the WINDOWS+A key to the unique id 88 for identification
   JIntellitype.getInstance().registerHotKey(WINDOWS_A, JIntellitype.MOD_WIN, 'A');
   JIntellitype.getInstance().registerHotKey(ALT_SHIFT_B, JIntellitype.MOD_ALT + JIntellitype.MOD_SHIFT, 'B');
   JIntellitype.getInstance().registerSwingHotKey(CTRL_SHIFT_C, Event.CTRL_MASK + Event.SHIFT_MASK, 'C');

   // use a 0 for the modifier if you just want a single keystroke to be a
   // hotkey
   JIntellitype.getInstance().registerHotKey(PRINT_SCREEN, 0, 44);
   JIntellitype.getInstance().registerHotKey(F11, "F11");
   JIntellitype.getInstance().registerHotKey(F12, JIntellitype.MOD_ALT, 123);
   JIntellitype.getInstance().registerHotKey(SEMICOLON, 0, 186);
   JIntellitype.getInstance().registerHotKey(TICK, 0, 192);
   // clear the text area
   textArea.setText("");
   output("RegisterHotKey WINDOWS+A was assigned uniqueID 88");
   output("RegisterHotKey ALT+SHIFT+B was assigned uniqueID 89");
   output("RegisterHotKey CTRL+SHIFT+C was assigned uniqueID 90");
   output("RegisterHotKey PRINT_SCREEN was assigned uniqueID 91");
   output("RegisterHotKey F9 was assigned uniqueID 92");
   output("RegisterHotKey F12 was assigned uniqueID 93");
   output("RegisterHotKey SEMICOLON was assigned uniqueID 94");
   output("Press WINDOWS+A or ALT+SHIFT+B or CTRL+SHIFT+C in another application and you will see the debug output in the textarea.");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号