Gondwana Game Engine Development (master) - 2.7.0
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
MouseEventArgs.cs
1using System.Drawing;
3
5
13public sealed class MouseEventArgs : EventArgs
14{
21
29
37 public IReadOnlyDictionary<MouseButton, MouseButtonState> ButtonStates { get; }
38
45 public Point PreviousPosition { get; }
46
52 public Point CurrentPosition { get; }
53
60 public int ScrollDelta { get; }
61
69
77
84
88 public long Tick { get; }
89
121 MouseEventConfiguration mouseEventConfiguration,
122 KeyboardModifierState currentKeyboardModifiers,
123 IReadOnlyDictionary<MouseButton, MouseButtonState> buttonStates,
124 Point previousPosition,
125 Point currentPosition,
126 int scrollDelta,
127 long tick)
128 {
129 MouseEventConfiguration = mouseEventConfiguration;
130 CurrentKeyboardModifiers = currentKeyboardModifiers;
131 ButtonStates = buttonStates;
132 PreviousPosition = previousPosition;
133 CurrentPosition = currentPosition;
134 ScrollDelta = scrollDelta;
135 Tick = tick;
136 }
137
151 public bool IsButtonDown(MouseButton button)
152 => ButtonStates.TryGetValue(button, out var state) && state.IsDown;
153
167 => ButtonStates.TryGetValue(button, out var state) && state.JustPressed;
168
182 => ButtonStates.TryGetValue(button, out var state) && state.JustReleased;
183
192
201
210
219
228
237
246
255
264}
Point PreviousPosition
Gets the previous position of the mouse cursor before the current polling interval....
bool IsButtonDown(MouseButton button)
Determines whether the specified mouse button is currently in the down (pressed) state.
bool MiddleButtonDown
Gets a value indicating whether the middle mouse button is currently pressed.
bool LeftButtonJustPressed
Gets a value indicating whether the left mouse button was pressed during the current polling interval...
Point CurrentPosition
Gets the current position of the mouse cursor at the time this event was generated....
bool IsCtrl
Gets a value indicating whether the Control (Ctrl) modifier key was pressed at the time this mouse ev...
long Tick
Gets the engine tick at the time this mouse event was generated.
MouseEventArgs(MouseEventConfiguration mouseEventConfiguration, KeyboardModifierState currentKeyboardModifiers, IReadOnlyDictionary< MouseButton, MouseButtonState > buttonStates, Point previousPosition, Point currentPosition, int scrollDelta, long tick)
Initializes a new instance of the MouseEventArgs class with comprehensive mouse state information inc...
bool IsButtonJustReleased(MouseButton button)
Determines whether the specified mouse button was released during the current polling interval.
KeyboardModifierState CurrentKeyboardModifiers
Gets the state of keyboard modifier keys (Shift, Ctrl, Alt) at the time this mouse event was generate...
int ScrollDelta
Gets the accumulated scroll wheel delta since the last poll, measured in implementation-defined units...
bool RightButtonJustReleased
Gets a value indicating whether the right mouse button was released during the current polling interv...
bool RightButtonJustPressed
Gets a value indicating whether the right mouse button was pressed during the current polling interva...
bool LeftButtonDown
Gets a value indicating whether the left mouse button is currently pressed.
bool MiddleButtonJustPressed
Gets a value indicating whether the middle mouse button was pressed during the current polling interv...
bool IsAlt
Gets a value indicating whether the Alt modifier key was pressed at the time this mouse event was gen...
bool RightButtonDown
Gets a value indicating whether the right mouse button is currently pressed.
IReadOnlyDictionary< MouseButton, MouseButtonState > ButtonStates
Gets a read-only dictionary mapping each monitored mouse button to its current state,...
bool IsShift
Gets a value indicating whether the Shift modifier key was pressed at the time this mouse event was g...
bool MiddleButtonJustReleased
Gets a value indicating whether the middle mouse button was released during the current polling inter...
bool IsButtonJustPressed(MouseButton button)
Determines whether the specified mouse button was pressed during the current polling interval.
bool LeftButtonJustReleased
Gets a value indicating whether the left mouse button was released during the current polling interva...
MouseEventConfiguration MouseEventConfiguration
Gets the configuration details for the mouse event monitoring, including throttling settings and paus...
KeyboardModifierState
Represents the state of keyboard modifier keys (Shift, Ctrl, Alt) that can be pressed simultaneously ...
MouseButton
Represents mouse button identifiers that can be used individually or combined to represent multiple s...