什么是关键$ C $下"而在.NET(点);,"(逗号)和QUOT;&QUOT?而在、逗号、关键、QUOT

2023-09-03 02:24:31 作者:骚猪

在我的的KeyDown 事件处理程序我需要知道什么是键$ C $ ç的,和。

In my KeyDown EventHandler I need to know what is the KeyCode for "," and ".".

我找不到他们这就是为什么我问。谢谢!

I can't find them thats why I ask. Thanks!

推荐答案

一个键和字符是不一样的事情。它们之间的键盘布局变换,并且变换是不平凡的。也许你在使用的KeyDown 做了错误的事情。如果你想知道哪些字符用户输入,你应该使用键preSS ,这给本已翻译的字符。

A key and a character are not the same thing. The keyboard layout transforms between them, and that transform isn't trivial. Probably you're doing the wrong thing when using KeyDown. If you want to know which character a user entered you should use KeyPress, which gives the the already translated character.

例如 Keys.Decimal 是对应于数字键盘的按键。在美国的布局, 在德国的布局。 Keys.Oemcomma OemPeriod 很可能初级讲座的字母。但在其他布局,也可以不同。

For example Keys.Decimal is a key on the numpad that corresponds to . on the US layout, and , on the German layout. Keys.Oemcomma and OemPeriod are likely , and . belows the letters. But on other layouts that may be different.