Gondwana Game Engine Development (master) - 2.6.1
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
120 public MouseEventArgs(MouseEventConfiguration mouseEventConfiguration,
121 KeyboardModifierState currentKeyboardModifiers,
122 IReadOnlyDictionary<MouseButton, MouseButtonState> buttonStates,
123 Point previousPosition,
124 Point currentPosition,
125 int scrollDelta,
126 long tick)
127 {
128 MouseEventConfiguration = mouseEventConfiguration;
129 CurrentKeyboardModifiers = currentKeyboardModifiers;
130 ButtonStates = buttonStates;
131 PreviousPosition = previousPosition;
132 CurrentPosition = currentPosition;
133 ScrollDelta = scrollDelta;
134 Tick = tick;
135 }
136
150 public bool IsButtonDown(MouseButton button)
151 => ButtonStates.TryGetValue(button, out var state) && state.IsDown;
152
166 => ButtonStates.TryGetValue(button, out var state) && state.JustPressed;
167
181 => ButtonStates.TryGetValue(button, out var state) && state.JustReleased;
182
191
200
209
218
227
236
245
254
263}
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...