diff --git a/Terminal.Gui/Core/Event.cs b/Terminal.Gui/Core/Event.cs
index 94d859dd6..1a72b897e 100644
--- a/Terminal.Gui/Core/Event.cs
+++ b/Terminal.Gui/Core/Event.cs
@@ -327,16 +327,13 @@ namespace Terminal.Gui {
/// Describes a keyboard event.
///
public class KeyEvent {
+ KeyModifiers keyModifiers;
+
///
/// Symb olid definition for the key.
///
public Key Key;
- ///
- /// Indicates the "shift" state of the various shift-keys (e.g. Shift, Alt, Ctrl, NumLock, ...).
- ///
- public KeyModifiers KeyModifiers;
-
///
/// The key value cast to an integer, you will typical use this for
/// extracting the Unicode rune value out of a key, when none of the
@@ -348,38 +345,38 @@ namespace Terminal.Gui {
/// Gets a value indicating whether the Shift key was pressed.
///
/// true if is shift; otherwise, false.
- public bool IsShift => KeyModifiers.Shift;
+ public bool IsShift => keyModifiers.Shift;
///
/// Gets a value indicating whether the Alt key was pressed (real or synthesized)
///
/// true if is alternate; otherwise, false.
- public bool IsAlt => KeyModifiers.Alt;
+ public bool IsAlt => keyModifiers.Alt;
///
/// Determines whether the value is a control key (and NOT just the ctrl key)
///
/// true if is ctrl; otherwise, false.
//public bool IsCtrl => ((uint)Key >= 1) && ((uint)Key <= 26);
- public bool IsCtrl => KeyModifiers.Ctrl;
+ public bool IsCtrl => keyModifiers.Ctrl;
///
/// Gets a value indicating whether the Caps lock key was pressed (real or synthesized)
///
/// true if is alternate; otherwise, false.
- public bool IsCapslock => KeyModifiers.Capslock;
+ public bool IsCapslock => keyModifiers.Capslock;
///
/// Gets a value indicating whether the Num lock key was pressed (real or synthesized)
///
/// true if is alternate; otherwise, false.
- public bool IsNumlock => KeyModifiers.Numlock;
+ public bool IsNumlock => keyModifiers.Numlock;
///
/// Gets a value indicating whether the Scroll lock key was pressed (real or synthesized)
///
/// true if is alternate; otherwise, false.
- public bool IsScrolllock => KeyModifiers.Scrolllock;
+ public bool IsScrolllock => keyModifiers.Scrolllock;
///
/// Constructs a new
@@ -387,7 +384,7 @@ namespace Terminal.Gui {
public KeyEvent ()
{
Key = Key.Unknown;
- KeyModifiers = new KeyModifiers ();
+ keyModifiers = new KeyModifiers ();
}
///
@@ -396,7 +393,7 @@ namespace Terminal.Gui {
public KeyEvent (Key k, KeyModifiers km)
{
Key = k;
- KeyModifiers = km;
+ keyModifiers = km;
}
///
@@ -404,22 +401,22 @@ namespace Terminal.Gui {
{
string msg = "";
var key = this.Key;
- if (KeyModifiers.Shift) {
+ if (keyModifiers.Shift) {
msg += "Shift-";
}
- if (KeyModifiers.Alt) {
+ if (keyModifiers.Alt) {
msg += "Alt-";
}
- if (KeyModifiers.Ctrl) {
+ if (keyModifiers.Ctrl) {
msg += "Ctrl-";
}
- if (KeyModifiers.Capslock) {
+ if (keyModifiers.Capslock) {
msg += "Capslock-";
}
- if (KeyModifiers.Numlock) {
+ if (keyModifiers.Numlock) {
msg += "Numlock-";
}
- if (KeyModifiers.Scrolllock) {
+ if (keyModifiers.Scrolllock) {
msg += "Scrolllock-";
}