mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Refactored keydown/up/press events to use event vs. Action<T>
This commit is contained in:
@@ -1070,6 +1070,11 @@ namespace Terminal.Gui {
|
||||
public KeyEvent KeyEvent { get; set; }
|
||||
}
|
||||
|
||||
public class KeyEventEventArgs : EventArgs {
|
||||
public KeyEventEventArgs(KeyEvent ke) => KeyEvent = ke;
|
||||
public KeyEvent KeyEvent { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a character key is pressed and occurs after the key up event.
|
||||
/// </summary>
|
||||
|
||||
@@ -562,9 +562,8 @@ namespace Terminal.Gui {
|
||||
}
|
||||
|
||||
bool openedByAltKey;
|
||||
|
||||
///<inheritdoc cref="KeyDown"/>
|
||||
public override bool KeyDown (KeyEvent keyEvent)
|
||||
public override bool OnKeyDown (KeyEvent keyEvent)
|
||||
{
|
||||
if (keyEvent.IsAlt) {
|
||||
openedByAltKey = true;
|
||||
|
||||
Reference in New Issue
Block a user