c# - How to handle missing values from VirtualKey enumeration in KeyRoutedEventArgs e -


using c#, i'm extending windows.ui.xaml.controls.textbox class handle custom formatting of input user types. logic called 2 event handlers, 1 textchanged event (for attempts paste data) , keydown event (for typed input).

my problem concerns keydown event , arguments, contained in keyroutedeventargs class. key press described virtualkey enumeration.

unfortunately enumeration missing many keys, such comma, tilde, or backspace.

additionally, delete present, when press textchanged event gets handled before keydown event. can mess behavior of control.

is there way of handling typed data give me control need in custom control?

backspace available, virtualkey.back.

the comma key oemcomma, (virtualkey)188. tilde character requires holding down shift key , pressing oem8 key, (virtualkey)223. in neck of woods not on spanish keyboard, use lot have dedicated ñ key , have press altgr + d4 plain tilde. can reverse-engineer other missing ones having @ system.windows.forms.keys enumeration and/or using debugger.

the acronym oem provides hint why these virtual key codes missing. oem means original equipment manufacturer. people design , manufacture keyboards. @ discretion whatever want oem keys. omit them or give them entirely different function or moving them unusual location. kind of thing can happen keyboards used people in far-flung places on planet earth. keyboard layouts stunningly difficult use western user. not locals of course.

in other words, these virtual key codes intentionally omitted because can't depend on keys being useful or present on user's device. should not use them. microsoft aggressively removed features winrt caused chronic localization problems.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -