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


Java KeyEvent.VK_ESCAPE属性代码示例

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


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

示例1: keyReleased

public void keyReleased(KeyEvent e) {
        System.out.println("hmd.getHSWDisplayState().Displayed=" + hmd.getHSWDisplayState().Displayed);

        if (!hswDone && hmd.getHSWDisplayState().Displayed == 1) {
            hmd.dismissHSWDisplay();
            hswDone = true;
        }

        if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
            shutdown();
        }
        if (e.getKeyCode() == KeyEvent.VK_F5) {
//            new Thread() {
//                public void run() {
//                    glWindow.setFullscreen(!glWindow.isFullscreen());
//                }
//            }.start();
        }
        if (e.getKeyCode() == KeyEvent.VK_R) {
            recenterView();
        }
    }
 
开发者ID:WhiteHexagon,项目名称:example-jovr-jogl-rift,代码行数:22,代码来源:RiftClient0440.java

示例2: keyPressed

@Override
public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
        new Thread(() -> {
            window.destroy();
        }).start();
    }
}
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:8,代码来源:HelloTriangle.java

示例3: keyPressed

@Override
public void keyPressed(KeyEvent e) {
    switch (e.getKeyCode()) {
        case KeyEvent.VK_ESCAPE:
            quit();
            break;
        case KeyEvent.VK_C:
            showCubes = !showCubes;
            break;
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:11,代码来源:Application.java

示例4: keyReleased

@Override
public void keyReleased(KeyEvent e) {

    switch (e.getKeyCode()) {
        case KeyEvent.VK_ESCAPE:
            animator.stop();
            glWindow.destroy();
            break;
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:10,代码来源:Test.java

示例5: keyPressed

/**
 * Updates the keys based on the event received by the component.
 */
public void keyPressed(KeyEvent e) {
	if (e.isAutoRepeat()) return;
	
	if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
		c.exit();
	}
	
	if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
		if (focused)
			setFocused(false);
	}
	if (e.getKeyCode() == KeyEvent.VK_F11) {
		c.toggleFullscreen();
		
		if (focused) {
			//Prevent sudden direction changes by resetting the mouse
			GLWindow win = c.getWindow();
			int centerX = win.getX() + win.getWidth()/2;
			int centerY = win.getY() + win.getHeight()/2;			
			robot.mouseMove(centerX, centerY);
		}
	}
	
	//Handle keys
	for (int i=0; i<NUM_KEYS; i++) {
		if (e.getKeyCode() == keyCode[i]) {
			if (!keyDown[i]) keyHelper[i] = true;
			keyDown[i] = true;
		}
	}
}
 
开发者ID:patowen,项目名称:hyperbolic-space,代码行数:34,代码来源:InputHandler.java

示例6: keyReleased

public void keyReleased(KeyEvent e) {
    System.out.println("hmd.getHSWDisplayState().Displayed=" + hmd.getHSWDisplayState().Displayed);
    if (!hswDone && hmd.getHSWDisplayState().Displayed == 1) {
        hmd.dismissHSWDisplay();
        hswDone = true;
    }
    if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
        shutdown();
    }
    if (e.getKeyCode() == KeyEvent.VK_R) {
        recenterView();
    }
}
 
开发者ID:WhiteHexagon,项目名称:example-jovr-jogl-rift,代码行数:13,代码来源:RiftClient0440NoMatirx.java

示例7: keyReleased

@Override
    public void keyReleased(KeyEvent e) {

        switch (e.getKeyCode()) {

            case KeyEvent.VK_Q:
                Resources.useOQ = !Resources.useOQ;
                break;
            case KeyEvent.VK_RIGHT:
                Resources.numPasses++;
                Resources.numLayers = (Resources.numPasses - 1) * 2;
                break;
            case KeyEvent.VK_LEFT:
                Resources.numPasses--;
                Resources.numPasses = Math.max(Resources.numPasses, 1);
                Resources.numLayers = (Resources.numPasses - 1) * 2;
                break;
            case KeyEvent.VK_B:
                Resources.backgroundColor = (Resources.backgroundColor.x == Resources.white.x)
                        ? Resources.black : Resources.white;
                break;
            case KeyEvent.VK_O:
//                Viewer.showOsd = !Viewer.showOsd;
                break;
            case KeyEvent.VK_1:
                Viewer.newOit = Viewer.Oit.DUAL_DEPTH_PEELING;
                break;
            case KeyEvent.VK_2:
                Viewer.newOit = Viewer.Oit.DEPTH_PEELING;
                break;
            case KeyEvent.VK_3:
                Viewer.newOit = Viewer.Oit.WEIGHTED_AVERAGE;
                break;
            case KeyEvent.VK_4:
                Viewer.newOit = Viewer.Oit.WEIGHTED_SUM;
                break;
            case KeyEvent.VK_5:
                Viewer.newOit = Viewer.Oit.WEIGHTED_BLENDED;
                break;
            case KeyEvent.VK_A:
                Resources.opacity -= 0.05f;
                Resources.opacity = (float) Math.max(Resources.opacity, 0.0);
                break;
            case KeyEvent.VK_D:
                Resources.opacity += 0.05f;
                Resources.opacity = (float) Math.min(Resources.opacity, 1.0);
                break;
            case KeyEvent.VK_W:
                Resources.weight -= 0.05f;
                Resources.weight = (float) Math.max(Resources.weight, 0.0);
                break;
            case KeyEvent.VK_S:
                Resources.weight += 0.05f;
                Resources.weight = (float) Math.min(Resources.weight, 1.0);
                break;
            case KeyEvent.VK_ESCAPE:
                Resources.animator.stop();
                break;
        }
    }
 
开发者ID:java-opengl-labs,项目名称:oit,代码行数:60,代码来源:InputListener.java


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