mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Adding a more realistic key down/up event with null key.
This commit is contained in:
@@ -388,19 +388,23 @@ namespace Terminal.Gui {
|
||||
void ProcessInput (ConsoleKeyInfo consoleKey)
|
||||
{
|
||||
keyModifiers = new KeyModifiers ();
|
||||
var map = MapKey (consoleKey);
|
||||
if (map == (Key)0xffffffff)
|
||||
return;
|
||||
|
||||
if (consoleKey.Modifiers.HasFlag (ConsoleModifiers.Alt)) {
|
||||
keyModifiers.Alt = true;
|
||||
}
|
||||
if (consoleKey.Modifiers.HasFlag (ConsoleModifiers.Shift)) {
|
||||
keyModifiers.Shift = true;
|
||||
}
|
||||
if (consoleKey.Modifiers.HasFlag (ConsoleModifiers.Alt)) {
|
||||
keyModifiers.Alt = true;
|
||||
}
|
||||
if (consoleKey.Modifiers.HasFlag (ConsoleModifiers.Control)) {
|
||||
keyModifiers.Ctrl = true;
|
||||
}
|
||||
var map = MapKey (consoleKey);
|
||||
if (map == (Key)0xffffffff) {
|
||||
if ((consoleKey.Modifiers & (ConsoleModifiers.Shift | ConsoleModifiers.Alt | ConsoleModifiers.Control)) != 0) {
|
||||
keyDownHandler (new KeyEvent (map, keyModifiers));
|
||||
keyUpHandler (new KeyEvent (map, keyModifiers));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
keyDownHandler (new KeyEvent (map, keyModifiers));
|
||||
keyHandler (new KeyEvent (map, keyModifiers));
|
||||
|
||||
Reference in New Issue
Block a user