aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Interface.cs
diff options
context:
space:
mode:
authorjp <jp_bruyere@hotmail.com>2016-03-18 12:39:38 +0100
committerjp <jp_bruyere@hotmail.com>2016-03-18 12:39:38 +0100
commit22644afe6f0722dcfb5fd27ba353f12274f55eb6 (patch)
tree7472299f2c96d9a071b6101bd97542b8e8fce306 /src/Interface.cs
parente5069093ba483ef8644c5cac685d76f2600606f0 (diff)
parent356bfaaed4f46a727ae033f37f362b062c8c32d9 (diff)
Merge branch 'master' of https://github.com/jpbruyere/Crow
Diffstat (limited to 'src/Interface.cs')
-rw-r--r--src/Interface.cs29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/Interface.cs b/src/Interface.cs
index 1084ef7b..4cb94e76 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -647,9 +647,7 @@ namespace Crow
hoverWidget.onMouseWheel (this, e);
return true;
}
-// public bool ProcessKeyDown(int Key){
-//
-// }
+
volatile bool mouseRepeatOn;
volatile int mouseRepeatCount;
Thread mouseRepeatThread;
@@ -665,6 +663,31 @@ namespace Crow
}
#endregion
+ #region Keyboard
+ public bool ProcessKeyDown(int Key){
+ Keyboard.SetKeyState ((Crow.Key)Key, true);
+ if (_focusedWidget == null)
+ return false;
+ KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard);
+ _focusedWidget.onKeyDown (this, e);
+ return true;
+ }
+ public bool ProcessKeyUp(int Key){
+ Keyboard.SetKeyState ((Crow.Key)Key, false);
+ if (_activeWidget == null)
+ return false;
+ //KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard);
+ return true;
+ }
+ public bool ProcessKeyPress(char Key){
+ if (_focusedWidget == null)
+ return false;
+ KeyPressEventArgs e = new KeyPressEventArgs(Key);
+ _focusedWidget.onKeyPress (this, e);
+ return true;
+ }
+ #endregion
+
#region ILayoutable implementation
public void RegisterClip(Rectangle r){
clipping.AddRectangle (r);