Beispiel #1
0
 // Through this method, the keys generated by the Virtual Keyboard are sent to the target control.
 // In this version, the current target control is always the control with input focus and the keyboard
 // is only visible when the control (to which the keyboard was previously attached) has input focus.
 // Therefore, SendKeys.Send offers all the logic needed for this version of the keyboard.
 //
 // For future versions, we might consider using the Win32 API SendInput function for greater flexibility.
 private void SendKeysToTarget(string info)
 {
     KeyboardKeyCancelEventArgs cancelArgs = new KeyboardKeyCancelEventArgs(info);
     OnSendingKey(cancelArgs);
     if (cancelArgs.Cancel) return;
     SendKeys.Send(info);
     OnKeySent(new KeyboardKeyEventArgs(info));
 }
Beispiel #2
0
 /// <summary>
 /// Raises SendingKey event.
 /// </summary>
 /// <param name="e">Provides event arguments.</param>
 protected virtual void OnSendingKey(KeyboardKeyCancelEventArgs e)
 {
     KeyCancelEventHandler handler = SendingKey;
     if (handler != null)
         handler(this, e);
 }
Beispiel #3
0
 private void VirtualKeyboardSendingKey(object sender, KeyboardKeyCancelEventArgs e)
 {
     OnSendingKey(e);
 }