aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Interface.cs
diff options
context:
space:
mode:
authorjp <jp_bruyere@hotmail.com>2016-03-15 07:59:09 +0100
committerjp <jp_bruyere@hotmail.com>2016-03-15 07:59:09 +0100
commit97e0683c77461e7f13ab40ff9bc6f8a56c7a9d7e (patch)
tree001ac2012271766dd7a9ebef4977fcb24409d591 /src/Interface.cs
parente21653876231f1ad18d44b1953582a5a87c9e1d6 (diff)
keyboard event handling
Diffstat (limited to 'src/Interface.cs')
-rw-r--r--src/Interface.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Interface.cs b/src/Interface.cs
index 1084ef7b..75310918 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -647,9 +647,22 @@ namespace Crow
hoverWidget.onMouseWheel (this, e);
return true;
}
-// public bool ProcessKeyDown(int Key){
-//
-// }
+ 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;
+ }
+
volatile bool mouseRepeatOn;
volatile int mouseRepeatCount;
Thread mouseRepeatThread;