You can use the following piece of code to always get the correct pressed key:. Under Windows, the "Alt" key is handled specially. When the Alt key itself is pressed or another key is pressed while the Alt key is held down, it is considered a "System" keypress.
It all starts out when Windows passes the keypress your application. When the Alt key is down, letters come in as three pairs of events: The primary differences here are:.
Explanation Under Windows, the "Alt" key is handled specially. The primary differences here are: System" rather than the key that was pressed, Onpreviewkeydown not called dating the SystemKey set to the actual key pressed. The TextInput event is passed normally but then handled as an AccessKey if it is not consumed.
Should that second code block be ModifierKeys. Thank you for the explanation of the ALT key handling. Thanks to both you and Julien. I'd been bashing my head against this for at least a couple of hours. Sign up or log in "Onpreviewkeydown not called dating" up using Google. Sign up using Facebook.
Sign up using Email and Password.
In case of an Alt modifier, host-wig.info returns host-wig.info and the real key is in e. SystemKey.
Onpreviewkeydown not called dating
You can use the following piece of code to always get. NET, Platform: WinForms, Product: XtraGrid Suite, Type: Question, Subject: Grid PreviewKeyDown not working when content is selected.