mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Added keyDownHandler to Unix
This commit is contained in:
@@ -369,7 +369,7 @@ namespace Terminal.Gui {
|
||||
};
|
||||
}
|
||||
|
||||
void ProcessInput (Action<KeyEvent> keyHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
|
||||
void ProcessInput (Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
|
||||
{
|
||||
int wch;
|
||||
var code = Curses.get_wch (out wch);
|
||||
@@ -422,8 +422,10 @@ namespace Terminal.Gui {
|
||||
keyHandler (new KeyEvent (Key.Esc));
|
||||
}
|
||||
} else if (wch == Curses.KeyTab) {
|
||||
keyDownHandler (new KeyEvent (MapCursesKey (wch)));
|
||||
keyHandler (new KeyEvent (MapCursesKey (wch)));
|
||||
} else {
|
||||
keyDownHandler (new KeyEvent ((Key)wch));
|
||||
keyHandler (new KeyEvent ((Key)wch));
|
||||
}
|
||||
// Cause OnKeyUp and OnKeyPressed. Note that the special handling for ESC above
|
||||
@@ -446,7 +448,7 @@ namespace Terminal.Gui {
|
||||
this.mainLoop = mainLoop;
|
||||
|
||||
(mainLoop.Driver as Mono.Terminal.UnixMainLoop).AddWatch (0, Mono.Terminal.UnixMainLoop.Condition.PollIn, x => {
|
||||
ProcessInput (keyHandler, keyUpHandler, mouseHandler);
|
||||
ProcessInput (keyHandler, keyDownHandler, keyUpHandler, mouseHandler);
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Mono.Terminal {
|
||||
|
||||
while (true) {
|
||||
n = poll (pollmap, (uint)pollmap.Length, 0);
|
||||
if (pollmap != null) {
|
||||
if (n > 0) {
|
||||
break;
|
||||
}
|
||||
if (mainLoop.idleHandlers.Count > 0 || CkeckTimeout (wait, ref pollTimeout)) {
|
||||
@@ -472,7 +472,7 @@ namespace Mono.Terminal {
|
||||
running = false;
|
||||
driver.Wakeup ();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether there are pending events to be processed.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user