public void KeyPressWithModifier(ushort keyAndModifier) { if ((keyAndModifier & KeyboardTables.InvalidFlag) > 0) { // This key is marked as invalid: ignore it. return; } // TODO: other modifiers. if ((keyAndModifier & KeyboardTables.ShiftModifier) > 0) { _Queue.Enqueue(QueuedEvent.CreateKeyDown(KeyboardKey.LeftShift)); } _Queue.Enqueue(QueuedEvent.CreateKeyPress((KeyboardKey)(keyAndModifier & 0x00ff))); if ((keyAndModifier & KeyboardTables.ShiftModifier) > 0) { _Queue.Enqueue(QueuedEvent.CreateKeyUp(KeyboardKey.LeftShift)); } ActionEvent(); }
public void KeyPress(KeyboardKey key) { _Queue.Enqueue(QueuedEvent.CreateKeyPress(key)); ActionEvent(); }