1 /** 2 * Module for mouse event args handling. 3 * 4 * Authors: 5 * Jacob Jensen 6 * License: 7 * https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE 8 */ 9 module poison.core.eventargs.mouseeventargs; 10 11 import dsfml.window : Mouse; 12 13 public alias MouseButton = Mouse.Button; 14 15 import poison.core.eventargs.buttoneventargs; 16 import poison.core.vector : Point; 17 18 /// Event args for mouse events. 19 class MouseEventArgs : ButtonEventArgs!MouseButton { 20 private: 21 /// The current position of the mouse. 22 Point _position; 23 24 public: 25 @property { 26 /// Gets the current position of the mouse. 27 Point position() { return _position; } 28 } 29 30 package(poison): 31 /// Creates a new instance of the mouse event args. 32 this() { 33 super(); 34 } 35 36 @property { 37 /// Sets the position of the mouse. 38 void position(Point newPosition) { 39 _position = newPosition; 40 } 41 } 42 }