diff options
| author | j-p <jp.bruyere@live.be> | 2016-03-16 10:41:22 +0000 |
|---|---|---|
| committer | j-p <jp.bruyere@live.be> | 2016-03-16 10:41:22 +0000 |
| commit | 356bfaaed4f46a727ae033f37f362b062c8c32d9 (patch) | |
| tree | 60d62ce23dbf7c1dc8ec5de4f0dcdb77eb66789c /src/Interface.cs | |
| parent | 6b0d7e5a317f4deb808b59f4393fb8b5d0488587 (diff) | |
| parent | c85cd50c4a6553679ebf92058aa1f609ede56d27 (diff) | |
Merge pull request #5 from jpbruyere/TwoWayBindings
Two way bindings
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 29 |
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); |