点 '.' 的 java keyevent 字段是什么?
我知道如何使用 keyevent 调用 1 ,应该像 aaa.keyPress(KeyEvent.VK_1);
现在我需要输入 (.) 点?但我找不到(KeyEvent.VK_DOT)或一些类似的命令。请帮忙
谢谢
I know how to call 1 using keyevent which should be like aaa.keyPress(KeyEvent.VK_1);
Now I need to type (.) dot? But I could not find (KeyEvent.VK_DOT) or some similar command. Please help
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
“点”称为句点;因此它是
VK_PERIOD
。The "dot" is called a period; hence it's
VK_PERIOD
.非常老的问题,非常基本的问题,但缺少正确答案。
对于常规点使用:
对于小键盘点使用:
Very old question, very basic question, but the correct answer is missing.
For regular dot use:
For numpad dot use:
VK_PERIOD 应该做你需要什么。
VK_PERIOD should do what you need.
顺便说一句,
VK_PERIOD
将无法完成它。有时,“显而易见的痛苦”答案并不完全有效。VK_PERIOD
确实不拾取数字键盘的点。它得到了主要句点,但你会想知道为什么它对小键盘不起作用。如果您需要尊重小键盘的点(这对于点的所有可想象的用途来说都是很有可能的),您必须使用
Or (如果您必须有您的 KeyCodes)
也可以工作。
VK_PERIOD
WILL NOT get it done, by the way. Sometimes the "painfully obvious" answer doesn't quite work.VK_PERIOD
DOES NOT pick up the numpad's dot. It gets the main period, but you're left wonder why it no worky for numpad.In case you need to respect numpad's dot (which is a strong possibility for all conceivable uses of a dot) you'll have to go with
Or (if you must have your KeyCodes)
will also work.
我正在使用 Java 8 和 Apache Netbeans。
VK_PERIOD
可以很好地处理小数和点。I am using Java 8 with Apache Netbeans.
VK_PERIOD
works fine with both decimals and dot.