using System; namespace SFML { namespace Window { //////////////////////////////////////////////////////////// /// /// Keyboard event parameters /// //////////////////////////////////////////////////////////// public class KeyEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the key arguments from a key event /// /// Key event //////////////////////////////////////////////////////////// public KeyEventArgs(KeyEvent e) { Code = e.Code; Alt = e.Alt != 0; Control = e.Control != 0; Shift = e.Shift != 0; System = e.System != 0; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[KeyEventArgs]" + " Code(" + Code + ")" + " Alt(" + Alt + ")" + " Control(" + Control + ")" + " Shift(" + Shift + ")" + " System(" + System + ")"; } /// Code of the key (see KeyCode enum) public Keyboard.Key Code; /// Is the Alt modifier pressed? public bool Alt; /// Is the Control modifier pressed? public bool Control; /// Is the Shift modifier pressed? public bool Shift; /// Is the System modifier pressed? public bool System; } //////////////////////////////////////////////////////////// /// /// Text event parameters /// //////////////////////////////////////////////////////////// public class TextEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the text arguments from a text event /// /// Text event //////////////////////////////////////////////////////////// public TextEventArgs(TextEvent e) { Unicode = Char.ConvertFromUtf32((int)e.Unicode); } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[TextEventArgs]" + " Unicode(" + Unicode + ")"; } /// UTF-16 value of the character public string Unicode; } //////////////////////////////////////////////////////////// /// /// Mouse move event parameters /// //////////////////////////////////////////////////////////// public class MouseMoveEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the mouse move arguments from a mouse move event /// /// Mouse move event //////////////////////////////////////////////////////////// public MouseMoveEventArgs(MouseMoveEvent e) { X = e.X; Y = e.Y; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[MouseMoveEventArgs]" + " X(" + X + ")" + " Y(" + Y + ")"; } /// X coordinate of the mouse cursor public int X; /// Y coordinate of the mouse cursor public int Y; } //////////////////////////////////////////////////////////// /// /// Mouse buttons event parameters /// //////////////////////////////////////////////////////////// public class MouseButtonEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the mouse button arguments from a mouse button event /// /// Mouse button event //////////////////////////////////////////////////////////// public MouseButtonEventArgs(MouseButtonEvent e) { Button = e.Button; X = e.X; Y = e.Y; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[MouseButtonEventArgs]" + " Button(" + Button + ")" + " X(" + X + ")" + " Y(" + Y + ")"; } /// Code of the button (see MouseButton enum) public Mouse.Button Button; /// X coordinate of the mouse cursor public int X; /// Y coordinate of the mouse cursor public int Y; } //////////////////////////////////////////////////////////// /// /// Mouse wheel event parameters /// //////////////////////////////////////////////////////////// public class MouseWheelEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the mouse wheel arguments from a mouse wheel event /// /// Mouse wheel event //////////////////////////////////////////////////////////// public MouseWheelEventArgs(MouseWheelEvent e) { Delta = e.Delta; X = e.X; Y = e.Y; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[MouseWheelEventArgs]" + " Delta(" + Delta + ")" + " X(" + X + ")" + " Y(" + Y + ")"; } /// Scroll amount public int Delta; /// X coordinate of the mouse cursor public int X; /// Y coordinate of the mouse cursor public int Y; } //////////////////////////////////////////////////////////// /// /// Joystick axis move event parameters /// //////////////////////////////////////////////////////////// public class JoystickMoveEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the joystick move arguments from a joystick move event /// /// Joystick move event //////////////////////////////////////////////////////////// public JoystickMoveEventArgs(JoystickMoveEvent e) { JoystickId = e.JoystickId; Axis = e.Axis; Position = e.Position; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[JoystickMoveEventArgs]" + " JoystickId(" + JoystickId + ")" + " Axis(" + Axis + ")" + " Position(" + Position + ")"; } /// Index of the joystick which triggered the event public uint JoystickId; /// Joystick axis (see JoyAxis enum) public Joystick.Axis Axis; /// Current position of the axis public float Position; } //////////////////////////////////////////////////////////// /// /// Joystick buttons event parameters /// //////////////////////////////////////////////////////////// public class JoystickButtonEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the joystick button arguments from a joystick button event /// /// Joystick button event //////////////////////////////////////////////////////////// public JoystickButtonEventArgs(JoystickButtonEvent e) { JoystickId = e.JoystickId; Button = e.Button; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[JoystickButtonEventArgs]" + " JoystickId(" + JoystickId + ")" + " Button(" + Button + ")"; } /// Index of the joystick which triggered the event public uint JoystickId; /// Index of the button public uint Button; } //////////////////////////////////////////////////////////// /// /// Joystick connection/disconnection event parameters /// //////////////////////////////////////////////////////////// public class JoystickConnectEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the joystick connect arguments from a joystick connect event /// /// Joystick button event //////////////////////////////////////////////////////////// public JoystickConnectEventArgs(JoystickConnectEvent e) { JoystickId = e.JoystickId; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[JoystickConnectEventArgs]" + " JoystickId(" + JoystickId + ")"; } /// Index of the joystick which triggered the event public uint JoystickId; } //////////////////////////////////////////////////////////// /// /// Size event parameters /// //////////////////////////////////////////////////////////// public class SizeEventArgs : EventArgs { //////////////////////////////////////////////////////////// /// /// Construct the size arguments from a size event /// /// Size event //////////////////////////////////////////////////////////// public SizeEventArgs(SizeEvent e) { Width = e.Width; Height = e.Height; } //////////////////////////////////////////////////////////// /// /// Provide a string describing the object /// /// String description of the object //////////////////////////////////////////////////////////// public override string ToString() { return "[SizeEventArgs]" + " Width(" + Width + ")" + " Height(" + Height + ")"; } /// New width of the window public uint Width; /// New height of the window public uint Height; } } }