The SendKeys class can be used to send keystrokes to the currently active window SendKeys::Send("{F12}"); To specify keys combined with any combination of SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following: For SHIFT prefix with + For CTRL prefix with ^ For […]
Category: Keypresses
Detecting Modifier Keys
Detecting A Modifier Key Is Pressed if (Control::ModifierKeys == Keys::Control) Detecting A Single Modifier Key Is Pressed if (Control::ModifierKeys & Keys::Shift) != 0)
Detecting Key Presses On A Form
Select the form: Set the KeyPreview property of the form to true so that keyboard messages are received by the form before they reach any controls on the form. Create a KeyPress event (detects keys down combined with any modifier key – i.e. no event for pressing CTRL and a modified key value for CTRL […]