代码之家  ›  专栏  ›  技术社区  ›  Snowrain

如果按下的按钮是CapsLk

  •  0
  • Snowrain  · 技术社区  · 8 年前

    如何检查按下的键是否为CapsLk。

        if(e2.getKeyChar() == ?)
    {
    
    text_area.setText("CapsLk is pressed")
    
    }
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   px06    8 年前
    if(e2.getKeyCode() == KeyEvent.VK_CAPS_LOCK){
        text_area.setText("CapsLk is pressed");
    }