com.jogamp.newt.event.KeyEvent.isShiftDown()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中com.jogamp.newt.event.KeyEvent.isShiftDown()方法的一些代码示例,展示了KeyEvent.isShiftDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.isShiftDown()方法的具体详情如下:
包路径:com.jogamp.newt.event.KeyEvent
类名称:KeyEvent
方法名:isShiftDown

KeyEvent.isShiftDown介绍

暂无

代码示例

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

public void run() {
    final float newGamma = gamma + ( e.isShiftDown() ? -0.1f : 0.1f );
    System.err.println("[set gamma]: "+gamma+" -> "+newGamma);
    if( Gamma.setDisplayGamma(glWindow, newGamma, brightness, contrast) ) {
      gamma = newGamma;
    }
  } } );
break;

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

public void run() {
    printlnState("[set pointer-confined pre]", "warp-center: "+e.isShiftDown());
    final boolean confine = !glWindow.isPointerConfined();
    glWindow.confinePointer(confine);
    printlnState("[set pointer-confined post]", "warp-center: "+e.isShiftDown());
    if( e.isShiftDown() ) {
      setConfinedFixedCenter(confine);
    } else if( !confine ) {
      setConfinedFixedCenter(false);
    }
  } } );
break;

代码示例来源:origin: nifty-gui/nifty-gui

@Nonnull
private KeyboardInputEvent convert(@Nonnull final KeyEvent e, final boolean isKeyDown, final int keyCode) {
 return new KeyboardInputEvent(keyCode, e.getKeyChar(), isKeyDown, e.isShiftDown(), e.isControlDown());
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

public void run() {
      final boolean wasVisible = glWindow.isVisible();
      {
        printlnState("[set visible pre]");
        glWindow.setVisible(!wasVisible);
        printlnState("[set visible post]");
      }
      if( wasVisible && !e.isShiftDown() ) {
        try {
          java.lang.Thread.sleep(5000);
        } catch (final InterruptedException e) {
          e.printStackTrace();
        }
        printlnState("[reset visible pre]");
        glWindow.setVisible(true);
        printlnState("[reset visible post]");
      }
  } } );
}

代码示例来源:origin: jzy3d/jzy3d-api

public void keyPressed(KeyEvent e) {
  if(!e.isShiftDown()){
    Coord2d move = new Coord2d();
    float offset = 0.1f;

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

public void run() {
    // none:  max-v
    // alt:   max-h
    // shift: max-hv
    // ctrl:  max-off
    final boolean horz, vert;
    if( e.isControlDown() ) {
      horz = false;
      vert = false;
    } else if( e.isShiftDown() ) {
      final boolean bothMax = glWindow.isMaximizedHorz() && glWindow.isMaximizedVert();
      horz = !bothMax;
      vert = !bothMax;
    } else if( !e.isAltDown() ) {
      horz = glWindow.isMaximizedHorz();
      vert = !glWindow.isMaximizedVert();
    } else if( e.isAltDown() ) {
      horz = !glWindow.isMaximizedHorz();
      vert = glWindow.isMaximizedVert();
    } else {
      vert = glWindow.isMaximizedVert();
      horz = glWindow.isMaximizedHorz();
    }
    printlnState("[set maximize pre]", "max[vert "+vert+", horz "+horz+"]");
    glWindow.setMaximized(horz, vert);
    printlnState("[set maximize post]", "max[vert "+vert+", horz "+horz+"]");
  } } );
break;

相关文章