简体   繁体   English

KeyEvent中有多少个Java KeyCode?

[英]How many java KeyCodes are there in KeyEvent?

How many codes can be returned by KeyEvent.getKeyCode()? KeyEvent.getKeyCode()可以返回多少个代码?

What is the range of the codes returned by KeyEvent.getKeyCode()? KeyEvent.getKeyCode()返回的代码范围是多少?

Are the KeyCodes listed on the javadoc for KeyEvent (VK_?) the only KeyCodes that can be returned, or are there more? javadoc上列出的KeyEvent (VK_?)的KeyCodes是唯一可以返回的KeyCodes,还是还有其他?

It doesn't look like there are any such guarantees, judging by this paragraph from the documentation: 从文档中的本段来看,似乎没有任何此类保证:

WARNING: Aside from those keys that are defined by the Java language (VK_ENTER, VK_BACK_SPACE, and VK_TAB), do not rely on the values of the VK_ constants. 警告:除了Java语言(VK_ENTER,VK_BACK_SPACE和VK_TAB)定义的那些键外,不要依赖VK_常量的值。 Sun reserves the right to change these values as needed to accomodate a wider range of keyboards in the future. Sun保留根据需要更改这些值的权利,以在将来适应更大范围的键盘。

这些都是可以由Key *方法返回的所有KeyCode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM