本文整理汇总了Java中org.jnativehook.GlobalScreen.removeNativeKeyListener方法的典型用法代码示例。如果您正苦于以下问题:Java GlobalScreen.removeNativeKeyListener方法的具体用法?Java GlobalScreen.removeNativeKeyListener怎么用?Java GlobalScreen.removeNativeKeyListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jnativehook.GlobalScreen
的用法示例。
在下文中一共展示了GlobalScreen.removeNativeKeyListener方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutdown
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void shutdown()
{
if (this.keyboardHook != null)
{
GlobalScreen.removeNativeKeyListener(this.keyboardHook);
}
}
示例2: cleanup
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void cleanup()
{
try
{
GlobalScreen.removeNativeKeyListener(this);
GlobalScreen.unregisterNativeHook();
}
catch (NativeHookException ex)
{
logger.log(Level.SEVERE, "There was a problem unregistering the native hook.", ex);
}
}
示例3: stopListeningToHotkeys
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/** Makes {@link HotkeyManager} stop listening to Hotkeys. */
public static void stopListeningToHotkeys() throws NativeHookException {
if (isListening) {
GlobalScreen.unregisterNativeHook();
GlobalScreen.removeNativeKeyListener(nkListener);
isListening = false;
}
}
示例4: keyListenStop
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void keyListenStop() throws NativeHookException {
GlobalScreen.removeNativeKeyListener(spKeylistener);
GlobalScreen.unregisterNativeHook();
}
示例5: unregister
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private void unregister() {
GlobalScreen.removeNativeKeyListener(this);
}
示例6: stopListening
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public boolean stopListening() {
GlobalScreen.removeNativeKeyListener(this);
return true;
}
示例7: disableListener
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void disableListener() {
GlobalScreen.removeNativeKeyListener(gkl);
}
示例8: disableListener
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private void disableListener(JButton btn) {
System.out.println("[SettingsDialog] Listener disabled");
GlobalScreen.removeNativeKeyListener(this);
Main.keyListener.enableListener();
btn.setEnabled(true);
}
示例9: unregisterGlobalKeyListener
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/**
* Unregister a NativeKeyListener
*/
public static void unregisterGlobalKeyListener(NativeKeyListener listener) {
GlobalScreen.removeNativeKeyListener(listener);
}
示例10: stopListening
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void stopListening() throws NativeHookException{
GlobalScreen.removeNativeKeyListener(keyboard);
GlobalScreen.removeNativeMouseListener(keyboard);
GlobalScreen.removeNativeMouseMotionListener(keyboard);
GlobalScreen.unregisterNativeHook();
}
示例11: itemStateChanged
import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/**
* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
public void itemStateChanged(ItemEvent e) {
ItemSelectable item = e.getItemSelectable();
if (item == menuItemEnable) {
try {
// Keyboard checkbox was changed, adjust listeners accordingly.
if (e.getStateChange() == ItemEvent.SELECTED) {
// Initialize native hook. This is done on window open because the
// listener requires the txtEventInfo object to be constructed.
GlobalScreen.registerNativeHook();
}
else {
GlobalScreen.unregisterNativeHook();
}
}
catch (NativeHookException ex) {
txtEventInfo.append("Error: " + ex.getMessage() + "\n");
}
// Set the enable menu item to the state of the hook.
menuItemEnable.setState(GlobalScreen.isNativeHookRegistered());
// Set enable/disable the sub-menus based on the enable menu item's state.
menuSubListeners.setEnabled(menuItemEnable.getState());
}
else if (item == menuItemKeyboardEvents) {
// Keyboard checkbox was changed, adjust listeners accordingly
if (e.getStateChange() == ItemEvent.SELECTED) {
GlobalScreen.addNativeKeyListener(this);
}
else {
GlobalScreen.removeNativeKeyListener(this);
}
}
else if (item == menuItemButtonEvents) {
// Button checkbox was changed, adjust listeners accordingly
if (e.getStateChange() == ItemEvent.SELECTED) {
GlobalScreen.addNativeMouseListener(this);
}
else {
GlobalScreen.removeNativeMouseListener(this);
}
}
else if (item == menuItemMotionEvents) {
// Motion checkbox was changed, adjust listeners accordingly
if (e.getStateChange() == ItemEvent.SELECTED) {
GlobalScreen.addNativeMouseMotionListener(this);
}
else {
GlobalScreen.removeNativeMouseMotionListener(this);
}
}
else if (item == menuItemWheelEvents) {
// Motion checkbox was changed, adjust listeners accordingly
if (e.getStateChange() == ItemEvent.SELECTED) {
GlobalScreen.addNativeMouseWheelListener(this);
}
else {
GlobalScreen.removeNativeMouseWheelListener(this);
}
}
}