What are the "OEM" keys in the System.Windows.Forms.Keys enumeration? (original) (raw)

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.

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?

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?

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 ;))

MathMax's user avatar

MathMax

6179 silver badges25 bronze badges

asked Feb 24, 2009 at 16:16

OwenP's user avatar

0

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

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.

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

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

dance2die's user avatar

dance2die

37k39 gold badges136 silver badges198 bronze badges

answered Feb 24, 2009 at 16:45

peterchen's user avatar

peterchenpeterchen

41.2k22 gold badges109 silver badges194 bronze badges

3

OEM means "Original Equipment Manufacturer" (or something relatively close to that). I think it's an attempt on WPF's part to be somewhat platform neutral. That's just an opinion though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.