当前位置: 首页>>代码示例>>Java>>正文


Java GlobalScreen.removeNativeKeyListener方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:9,代码来源:IntegrationKeyboard.java

示例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);
	}
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:13,代码来源:HotkeyManager.java

示例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;
	}
}
 
开发者ID:ubershy,项目名称:StreamSis,代码行数:9,代码来源:HotkeyManager.java

示例4: keyListenStop

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void keyListenStop() throws NativeHookException {
	GlobalScreen.removeNativeKeyListener(spKeylistener);
	GlobalScreen.unregisterNativeHook();
}
 
开发者ID:niwatolli3,项目名称:NiwaLaunchee,代码行数:5,代码来源:NiwaSystem.java

示例5: unregister

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private void unregister() {
	GlobalScreen.removeNativeKeyListener(this);
}
 
开发者ID:GamesRythmAnalysis,项目名称:RNGames,代码行数:4,代码来源:KeyboardListener.java

示例6: stopListening

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public boolean stopListening() {
	GlobalScreen.removeNativeKeyListener(this);
	return true;
}
 
开发者ID:repeats,项目名称:Repeat,代码行数:6,代码来源:GlobalKeyListener.java

示例7: disableListener

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void disableListener() {
	GlobalScreen.removeNativeKeyListener(gkl);
}
 
开发者ID:HermexTools,项目名称:client-legacy,代码行数:4,代码来源:MyKeyListener.java

示例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);
}
 
开发者ID:HermexTools,项目名称:client-legacy,代码行数:7,代码来源:SettingsDialog.java

示例9: unregisterGlobalKeyListener

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/**
 * Unregister a NativeKeyListener
 */
public static void unregisterGlobalKeyListener(NativeKeyListener listener) {
    GlobalScreen.removeNativeKeyListener(listener);
}
 
开发者ID:Matt529,项目名称:CCAutotyper,代码行数:7,代码来源:Autotyper.java

示例10: stopListening

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void stopListening() throws NativeHookException{
  GlobalScreen.removeNativeKeyListener(keyboard);
  GlobalScreen.removeNativeMouseListener(keyboard);
  GlobalScreen.removeNativeMouseMotionListener(keyboard);
  GlobalScreen.unregisterNativeHook();
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:7,代码来源:Keyboard.java

示例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);
		}
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:66,代码来源:NativeHookDemo.java


注:本文中的org.jnativehook.GlobalScreen.removeNativeKeyListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。