Added F11 and F12 keys #220. Changed keyDownHandler to before keyHandler.

This commit is contained in:
BDisp
2020-05-24 14:04:58 +01:00
parent a8bb7e82e1
commit f7e9ccc766
4 changed files with 14 additions and 2 deletions

View File

@@ -136,6 +136,8 @@ namespace Terminal.Gui {
case Curses.KeyF8: return Key.F8;
case Curses.KeyF9: return Key.F9;
case Curses.KeyF10: return Key.F10;
case Curses.KeyF11: return Key.F11;
case Curses.KeyF12: return Key.F12;
case Curses.KeyUp: return Key.CursorUp;
case Curses.KeyDown: return Key.CursorDown;
case Curses.KeyLeft: return Key.CursorLeft;

View File

@@ -685,8 +685,8 @@ namespace Terminal.Gui {
} else {
if (inputEvent.KeyEvent.bKeyDown) {
// Key Down - Fire KeyDown Event and KeyStroke (ProcessKey) Event
keyHandler (new KeyEvent (map));
keyDownHandler (new KeyEvent (map));
keyHandler (new KeyEvent (map));
} else {
keyUpHandler (new KeyEvent (map));
}
@@ -1016,7 +1016,7 @@ namespace Terminal.Gui {
return (Key)((uint)keyInfo.KeyChar);
}
if (key >= ConsoleKey.F1 && key <= ConsoleKey.F10) {
if (key >= ConsoleKey.F1 && key <= ConsoleKey.F12) {
var delta = key - ConsoleKey.F1;
return (Key)((int)Key.F1 + delta);

View File

@@ -272,6 +272,14 @@ namespace Terminal.Gui {
/// </summary>
F10,
/// <summary>
/// F11 key.
/// </summary>
F11,
/// <summary>
/// F12 key.
/// </summary>
F12,
/// <summary>
/// The key code for the user pressing the tab key (forwards tab key).
/// </summary>
Tab,

View File

@@ -112,6 +112,8 @@ namespace Unix.Terminal {
public const int KeyF8 = unchecked((int)0x110);
public const int KeyF9 = unchecked((int)0x111);
public const int KeyF10 = unchecked((int)0x112);
public const int KeyF11 = unchecked((int)0x113);
public const int KeyF12 = unchecked((int)0x114);
public const int KeyResize = unchecked((int)0x19a);
public const int ShiftKeyUp = unchecked((int)0x151);
public const int ShiftKeyDown = unchecked((int)0x150);