I have some code which is (supposed to be) capturing keystrokes. The top level window has a
Keyboard.PreviewKeyDown=\"Window_PreviewKeyDown\"
In case of an Alt modifier, e.Key returns Key.System and the real key is in e.SystemKey. You can use the following piece of code to always get the correct pressed key:
Alt
e.Key
Key.System
e.SystemKey
Key key = (e.Key == Key.System ? e.SystemKey : e.Key);