本文整理匯總了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);
}
}
}