Пример #1
0
 public InputEventKeyboard(KeyboardEvent eventType, InputEventKeyboard parent)
     : base(parent)
 {
     EventType      = eventType;
     KeyCode        = parent.KeyCode;
     m_KeyDataExtra = parent.m_KeyDataExtra;
 }
Пример #2
0
 void OnKeyDown(InputEventKeyboard e)
 {
     if (e.DataPreviousState == 0)
     {
         AddEvent(new InputEventKeyboard(KeyboardEvent.Down, e));
     }
     for (int i = 0; i < e.DataRepeatCount; i++)
     {
         AddEvent(new InputEventKeyboard(KeyboardEvent.Press, e));
     }
 }
Пример #3
0
 public bool HandleKeyboardEvent(KeyboardEvent type, WinKeys key, bool shift, bool alt, bool ctrl)
 {
     foreach (InputEvent e in m_Events)
     {
         if (!e.Handled && e is InputEventKeyboard)
         {
             InputEventKeyboard ek = e as InputEventKeyboard;
             if (ek.EventType == type && ek.KeyCode == key &&
                 ek.Shift == shift && ek.Alt == alt && ek.Control == ctrl)
             {
                 e.Handled = true;
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #4
0
        void OnKeyChar(InputEventKeyboard e)
        {
            // Control key sends a strange wm_char message ...
            if (e.Control && !e.Alt)
            {
                return;
            }
            InputEventKeyboard ek = LastKeyPressEvent;

            if (ek == null)
            {
                Tracer.Warn("No corresponding KeyPress event for a WM_CHAR message.");
            }
            else
            {
                ek.OverrideKeyChar(e.KeyCode);
            }
        }
Пример #5
0
 void OnKeyUp(InputEventKeyboard e)
 {
     AddEvent(new InputEventKeyboard(KeyboardEvent.Up, e));
 }