My goal is to implement a custom Control + S key press handler to wire up to a custom save method in a winforms app.
There are several ways to accomplish this based
I solved this by doing,
if(e.KeyData==(Keys.S | Keys.Control))
Set the KeyPreview
property of our form to true
. The summary of this property says: "Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus.". Then use the KeyUp
event. Unless KeyPressed
it gives also information on special keys like control keys.