2015-02-23 67 views

回答

0

docs

按下或释放键为通过getKeyCodegetExtendedKeyCode方法,该方法返回一个虚拟键码指示。

您可以自己从java.lang.Enum.KeyCode的文档数键码的数量:

如果你为了检测键盘布局做这个,忘了键码。请做:

InputContext context = InputContext.getInstance(); 
System.out.println(context.getLocale().toString());