diff doodle/tk/events.d @ 63:20d6327c4a75

Event progress. Got key press/release working and panning via keyboard.
author daveb
date Thu, 12 Aug 2010 16:35:24 +0930
parents c63719604adb
children eb5436b47d13
line wrap: on
line diff
--- a/doodle/tk/events.d	Thu Aug 12 11:48:55 2010 +0930
+++ b/doodle/tk/events.d	Thu Aug 12 16:35:24 2010 +0930
@@ -5,6 +5,11 @@
     import doodle.tk.geometry;
 }
 
+// FIXME
+// Do we need FocusEvent, Enter/LeaveEvent ?
+// Note, FocusEvent has no mask but Enter/Leave do.
+// Hence would need to refactor hierarchy slightly, eg InputEvent
+
 abstract class Event {
     this(in Mask mask) {
         _mask = mask;
@@ -17,11 +22,6 @@
     }
 }
 
-/+
-final class FocusEvent : Event {
-}
-+/
-
 final class KeyEvent : Event {
     this(in string str, in uint value, in Mask mask) {
         super(mask);
@@ -30,6 +30,7 @@
     }
 
     string str() const { return _str; }
+    uint value() const { return _value; }
 
     override string toString() const {
         return std.string.format("Key event: %s, %d, %s", _str, _value, _mask);