]> O.S.I.I.S - jp/crow.git/commitdiff
tab key
authorjp <jp_bruyere@hotmail.com>
Tue, 15 Mar 2016 13:38:35 +0000 (14:38 +0100)
committerjp <jp_bruyere@hotmail.com>
Tue, 15 Mar 2016 13:38:35 +0000 (14:38 +0100)
src/GraphicObjects/TextBox.cs
src/Interface.cs

index d3b8319c0256a42b3e90d34a9b112dfd127ebbb7..6d2d8ca06f68fe2584e342d5ee1424a1b7ed9db1 100644 (file)
@@ -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;
                        }
index 86f3008818548801ad49cefd2032dd43d998c890..4cb94e76d2fb492aed3465d819e0bb907f5ae28a 100644 (file)
@@ -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