什么是"OEM"? System.Windows.Forms.Keys枚举中的键? [英] What are the "OEM" keys in the System.Windows.Forms.Keys enumeration?

查看:343
本文介绍了什么是"OEM"? System.Windows.Forms.Keys枚举中的键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个朋友在弄清楚如何为ToolStripMenuItem分配"Ctrl + +"作为快捷键时遇到了麻烦.我指出Keys.OemPlus键可以工作,并且需要设置快捷方式的显示字符串,但是Keys枚举使我感到迷惑.

A friend was having trouble figuring out how to assign "Ctrl + +" as a shortcut key to a ToolStripMenuItem. I pointed out that the Keys.OemPlus key would work and the display string for the shortcut needed to be set, but the Keys enumeration mystifies me.

这些"OEM"键有什么用?我做了一些搜索,这似乎是因为密钥仅在Win2k或更高版本中受支持,但这似乎很荒谬,因为我敢肯定,人们在Win2k之前已经使用了加号键.为什么没有"OemEquals"? Keys枚举中是否还没有其他键?

What's the deal with these "OEM" keys? I've done a little searching and it seems like it's because the keys are only supported in Win2k or later, but that seems ridiculous as I'm certain people have been using the plus key decades before Win2k. Why's there no "OemEquals"? Are there other keys that are completely absent from the Keys enumeration?

我主要是在寻找为什么存在这些特殊名称的值的答案,但是我很想听听有关其他问题的讨论.是否可以安全地假设由于加号位于键盘上的等号之上,因此可以使用Keys.OemPlus并检查Shift修饰键来判断是否单击了Ctrl + =?还有其他遗漏的键吗?

I'm mostly looking for an answer to why these special-named values exist, but I'd love to hear discussion about the other questions. Is it safe to assume that since the plus sign is on top of the equals sign on my keyboard that using Keys.OemPlus and checking the Shift modifier key is an OK to tell if Ctrl + = was clicked? Are there other keys that were omitted?

请注意,尽管System.Windows.Forms.KeysSystem.Windows.Input.Key枚举看起来相同(尽管根据框架设计指南,Key的命名不正确;),但这不是WPF问题. >

Note this is not a WPF question, though the System.Windows.Forms.Keys and System.Windows.Input.Key enumerations look identical (though Key is named incorrectly according to the Framework Design Guidelines ;))

推荐答案

它们是Windows API引入的,不是特定于WPF的.

They were introduced with the Windows API, they are not specific to WPF.

首先,这些是 KEY 代码,而不是字符代码:它们标识键盘上的键,而不是字符-例如通常,在按住SHIFT键的同时按下A键或同时启用CAPS LOCK键,通常会通过按下A键来生成"A"字符.

First, these are KEY codes, not character codes: they identify a key on your keyboard, not a character - e.g. the 'A' character is usually generated by pressing the A key while holding down a SHIFT key or having CAPS LOCK active.

OEM键随本地键盘而变化的键.美国键盘有括号和花括号的地方,德国键盘有变音符号.

The OEM keys are the keys that vary with local keyboards. Where the US keyboard has brackets and braces, german keyboards have umlauts.

之所以称为"OEM",是因为(键盘的)原始设备制造商负责定义其功能.

They are called "OEM" because the Original Equipment Manufacturer (of the keyboard) was responsible for defining their functionality.

这篇关于什么是"OEM"? System.Windows.Forms.Keys枚举中的键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆