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


Java GlobalScreen.unregisterNativeHook方法代码示例

本文整理汇总了Java中org.jnativehook.GlobalScreen.unregisterNativeHook方法的典型用法代码示例。如果您正苦于以下问题:Java GlobalScreen.unregisterNativeHook方法的具体用法?Java GlobalScreen.unregisterNativeHook怎么用?Java GlobalScreen.unregisterNativeHook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jnativehook.GlobalScreen的用法示例。


在下文中一共展示了GlobalScreen.unregisterNativeHook方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIpFromUser

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private void getIpFromUser() {
	GlobalScreen.unregisterNativeHook();
	Scanner scanner = new Scanner(System.in);
	
	String ip;
	do {
		System.out.println();
		System.out.println("PLEASE TYPE IN YOUR OPPONENTS IP ADDRESS: ");
		ip = scanner.next();
	}			
	while(!ip.matches(IP_PATTERN));
	
	try {
		InetAddress ipAddress = InetAddress.getByName(ip);
		System.out.println(ipAddress.toString());
		controller.startMultiplayerMode(ipAddress);
		this.gameState = GameState.Multiplayer;
	} catch (UnknownHostException e) {
		System.out.println("could not find host " + e);
		controller.stopGame();
	} finally {
		scanner.close();
		registerNativeHook();
	}
}
 
开发者ID:manuelz120,项目名称:tetris4j,代码行数:26,代码来源:TetrisView.java

示例2: PmTrans

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private PmTrans(GlobalKeyListener gkl) {
	// Initialize the interface
	d = new Display();
	shell = new Shell(d);
	menuManager = new MenuManager(shell, this);
	barManager = new BarManager(shell, this);

	// Global keys
	this.gKL = gkl;

	initState();
	initGui();
	startAutoSave();

	shell.open();

	while (!shell.isDisposed())
		if (!d.readAndDispatch())
			d.sleep();

	if (player != null) {
		player.close();
		player = null;
	}
	GlobalScreen.unregisterNativeHook();
	saveState();
	try {
		Config.getInstance().save();
	} catch (IOException e) {
		// ignore
	}
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:33,代码来源:PmTrans.java

示例3: shutdown

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void shutdown() throws Exception
{
	try
	{
		GlobalScreen.unregisterNativeHook();
	}
	catch (NativeHookException e)
	{
		throw new RuntimeException(e);
	}
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:13,代码来源:GlobalHookFakeIntegration.java

示例4: nativeKeyPressed

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void nativeKeyPressed(NativeKeyEvent e) {
    System.out.println("Key Pressed: " + NativeKeyEvent.getKeyText(e.getKeyCode()));

    if (e.getKeyCode() == NativeKeyEvent.VC_ESCAPE) {
        try {
            GlobalScreen.unregisterNativeHook();
        } catch (NativeHookException ex) {
            ex.printStackTrace();
        }
    }
}
 
开发者ID:maximova136,项目名称:j-demo,代码行数:13,代码来源:Main.java

示例5: stop

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void stop() {
    try {
        GlobalScreen.unregisterNativeHook();
    } catch (NativeHookException ex) {
        System.err.println("There was a problem while unregistering the native hook.");
        System.err.println(ex.getMessage());
    }
    System.out.println("Unregistered successfully");
    File file = new File("screenshot.png");
    file.delete();
    System.runFinalization();
    System.exit(0);
}
 
开发者ID:maximova136,项目名称:j-demo,代码行数:15,代码来源:Main.java

示例6: exit

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/**
 * Shuts down the program
 */
protected static final void exit(){
	try {
		GlobalScreen.unregisterNativeHook();
	} catch (NativeHookException e1) {
		e1.printStackTrace();
	}
	System.exit(0);
}
 
开发者ID:RoanH,项目名称:KeysPerSecond,代码行数:12,代码来源:Main.java

示例7: nativeKeyPressed

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void nativeKeyPressed(NativeKeyEvent e) {

		if (e.getKeyCode() == NativeKeyEvent.VC_ESCAPE) {
			try {
				GlobalScreen.unregisterNativeHook();
				System.exit(1);
			} catch (NativeHookException e1) {

			}
		}
	}
 
开发者ID:shiyafeng,项目名称:foolqq,代码行数:12,代码来源:GlobalKeyListener.java

示例8: disableHooks

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
/**
 * Call this static method when you don't need to listen to events anymore.
 * It unregisters native hook and stops catching mouse events at all.
 */
static void disableHooks() {
    try {
        GlobalScreen.unregisterNativeHook();
    } catch (NativeHookException | UnsatisfiedLinkError e) {
        e.printStackTrace();
    }
}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:12,代码来源:MouseEventNotificator.java

示例9: shutdownVirtualizer

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
public void shutdownVirtualizer() {
	try {
		GlobalScreen.unregisterNativeHook();
	} catch (NativeHookException e1) {
		e1.printStackTrace();
	}
	System.runFinalization();
}
 
开发者ID:alireza6677,项目名称:JeyBoard,代码行数:9,代码来源:Virtualizer.java

示例10: run

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void run() {
   try {
      GlobalScreen.unregisterNativeHook();
      speeker.stop();
      log.info("TypeTalk shutdown complete");
   } catch (NativeHookException ex) {
      log.warn("Unable to unregister native hook");
   }
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:11,代码来源:Application.java

示例11: run

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void run() {
   try {
      GlobalScreen.unregisterNativeHook();
      speeker.stop();
      log.info("SpeechLess shutdown complete");
   } catch (NativeHookException ex) {
      log.warn("Unable to unregister native hook");
   }
}
 
开发者ID:raginggoblin,项目名称:speechless,代码行数:11,代码来源:Application.java

示例12: nativeKeyPressed

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
@Override
public void nativeKeyPressed(NativeKeyEvent e) {
    System.out.println("Key Pressed: " + NativeKeyEvent.getKeyText(e.getKeyCode()));

    if (e.getKeyCode() == NativeKeyEvent.VC_ESCAPE) {
        try {
            GlobalScreen.unregisterNativeHook();
        } catch (NativeHookException ex) {
            Logger.getLogger(GlobalKeyListenerExample.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:13,代码来源:GlobalKeyListenerExample.java

示例13: 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

示例14: 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

示例15: onShutdown

import org.jnativehook.GlobalScreen; //导入方法依赖的package包/类
private static void onShutdown() {
    Console.debug("Finalizing Registers...");
    JUnique.releaseLock(Ref.APP_ID);
    try {
        GlobalScreen.unregisterNativeHook();
    } catch (NativeHookException e) {
        Console.exception(e);
    }
}
 
开发者ID:Matt529,项目名称:CCAutotyper,代码行数:10,代码来源:Autotyper.java


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