當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。