【问题标题】:Java Keystroke catchining directional keysJava Keystroke捕捉方向键
【发布时间】:2009-10-29 14:53:46
【问题描述】:

我正在捕捉绑定键,到目前为止,大多数角色都可以正常工作,直到我到达方向键(左上右下)

我捕获其他键的代码是:

KeyStroke key_3 = KeyStroke.getKeyStroke("3");

如何捕捉方向键?

谢谢!

【问题讨论】:

    标签: java


    【解决方案1】:
    KeyStroke.getKeyStroke("UP")
    

    你可以指定 ctrl 和 shift 版本

    KeyStroke.getKeyStroke("control UP")
    KeyStroke.getKeyStroke("shift UP"
    

    【讨论】:

      猜你喜欢
      • 2012-06-05
      • 2015-03-31
      • 2012-09-21
      • 1970-01-01
      • 1970-01-01
      • 2011-10-21
      • 2011-01-16
      • 2014-01-01
      • 1970-01-01
      相关资源
      最近更新 更多