开发者

How can I handle an alt graph keystroke?

I want to add a keyboard binding to a JTextField, but I cannot make it work using the alt graph key.

I followed the keyboard bindings tutorial and tried this:

inputMap.put(KeyStroke.getKeyStroke("altGraph ENTER"), ...
inputMap.put(getKeyStroke(KeyEvent.VK_O, InputEvent.ALT_GRAPH_DOWN_MASK), ...
开发者_如何学Python

but the action is never triggered. If I replace altGraph with alt it works.

What can I do to make it work?

If it matters: I'm using Java 6 and Windows.


Did you try

KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_GRAPH_DOWN_MASK)

?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜