From 18b2b07d3d018c8bd682bbeb0dbc6fae9572f5a8 Mon Sep 17 00:00:00 2001 From: jp Date: Tue, 15 Mar 2016 14:38:35 +0100 Subject: [PATCH] tab key --- src/GraphicObjects/TextBox.cs | 3 +++ 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 -- 2.47.3