diff dynamin/gui/events.d @ 72:8dac206ea523

Add shift/control/altDown to KeyEventArgs.
author Jordan Miner <jminer7@gmail.com>
date Tue, 11 Aug 2009 01:45:42 -0500
parents c138461bf845
children 73060bc3f004
line wrap: on
line diff
--- a/dynamin/gui/events.d	Mon Aug 10 17:04:08 2009 -0500
+++ b/dynamin/gui/events.d	Tue Aug 11 01:45:42 2009 -0500
@@ -119,10 +119,14 @@
 class KeyEventArgs : StopEventArgs {
 	Key _key;
 	bool _repeat;
+	bool _shiftDown, _controlDown, _altDown;
 public:
-	this(Key key, bool repeat) {
+	this(Key key, bool repeat, bool shift, bool ctrl, bool alt) {
 		_key = key;
 		_repeat = repeat;
+		_shiftDown = shift;
+		_controlDown = ctrl;
+		_altDown = alt;
 	}
 	/**
 	 * Returns: the key that was typed.
@@ -135,6 +139,12 @@
 	 *          if the key was just pressed
 	 */
 	bool repeat() { return _repeat; }
+	// Returns true if the shift key is currently down and false otherwise.
+	bool shiftDown() { return _shiftDown; }
+	// Returns true if the control key is currently down and false otherwise.
+	bool controlDown() { return _controlDown; }
+	// Returns true if the alt key is currently down and false otherwise.
+	bool altDown() { return _altDown; }
 	string toString() {
 		return format("KeyEventArgs [key={}, repeat={}]", _key, _repeat);
 	}