问题
I want to allow a shortcut configuration for my application that works around the world. That's why I load them from resource bundles. I first wanted to simply put the resource value for the shortcut directly to javax.swing.KeyStroke.getKeyStroke(String)
, but that doesn't work for unicode keyboards, e.g. arabic:
KeyStroke test = KeyStroke.getKeyStroke("control ش");
// test is null, i.e. it did not work
ش is the arabic keyboard key of A.
Is there a easy way to allow String
definition of international keystrokes for java?
回答1:
It does not work with pressed keystrokes:
KeyStroke test = KeyStroke.getKeyStroke("control typed ش");
// test not null, works
来源:https://stackoverflow.com/questions/22807892/how-to-allow-configurable-shortcuts-for-all-languages-i-e-how-to-map-unicode-k