diff options
| author | jp <jp_bruyere@hotmail.com> | 2016-03-15 14:38:35 +0100 |
|---|---|---|
| committer | jp <jp_bruyere@hotmail.com> | 2016-03-15 14:38:35 +0100 |
| commit | 18b2b07d3d018c8bd682bbeb0dbc6fae9572f5a8 (patch) | |
| tree | 860fa095bd0fee9b7e6db4659aaf327dd0b07cc5 | |
| parent | 7d84e81ebdc0bf89b5aa89cef2375c4acae7b37e (diff) | |
tab key
| -rw-r--r-- | src/GraphicObjects/TextBox.cs | 3 | ||||
| -rw-r--r-- | src/Interface.cs | 32 |
2 files changed, 20 insertions, 15 deletions
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs index d3b8319c..6d2d8ca0 100644 --- a/src/GraphicObjects/TextBox.cs +++ b/src/GraphicObjects/TextBox.cs @@ -72,6 +72,7 @@ namespace Crow public override void onKeyDown (object sender, KeyboardKeyEventArgs e) { base.onKeyDown (sender, e); + Key key = e.Key; switch (key) @@ -140,6 +141,8 @@ namespace Crow break; case Key.RWin: break; + case Key.Tab: + this.Insert("\t"); default: break; } diff --git a/src/Interface.cs b/src/Interface.cs index 86f30088..4cb94e76 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -647,6 +647,23 @@ namespace Crow hoverWidget.onMouseWheel (this, e); return true; } + + volatile bool mouseRepeatOn; + volatile int mouseRepeatCount; + Thread mouseRepeatThread; + void mouseRepeatThreadFunc() + { + mouseRepeatOn = true; + Thread.Sleep (Interface.DeviceRepeatDelay); + while (mouseRepeatOn) { + mouseRepeatCount++; + Thread.Sleep (Interface.DeviceRepeatInterval); + } + mouseRepeatCount = 0; + } + #endregion + + #region Keyboard public bool ProcessKeyDown(int Key){ Keyboard.SetKeyState ((Crow.Key)Key, true); if (_focusedWidget == null) @@ -662,7 +679,6 @@ namespace Crow //KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); return true; } - public bool ProcessKeyPress(char Key){ if (_focusedWidget == null) return false; @@ -670,20 +686,6 @@ namespace Crow _focusedWidget.onKeyPress (this, e); return true; } - - volatile bool mouseRepeatOn; - volatile int mouseRepeatCount; - Thread mouseRepeatThread; - void mouseRepeatThreadFunc() - { - mouseRepeatOn = true; - Thread.Sleep (Interface.DeviceRepeatDelay); - while (mouseRepeatOn) { - mouseRepeatCount++; - Thread.Sleep (Interface.DeviceRepeatInterval); - } - mouseRepeatCount = 0; - } #endregion #region ILayoutable implementation |