MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Mouse_EventHandler

Function Mouse_EventHandler

src/input/mouse.c:77–90  ·  view source on GitHub ↗

* Handle the new mouse event. */

Source from the content-addressed store, hash-verified

75 * Handle the new mouse event.
76 */
77void Mouse_EventHandler(uint16 mousePosX, uint16 mousePosY, bool mouseButtonLeft, bool mouseButtonRight)
78{
79 uint8 newButtonState = (mouseButtonLeft ? 0x1 : 0x0) | (mouseButtonRight ? 0x2 : 0x0);
80
81 if (g_mouseDisabled == 0) {
82 if (g_mouseMode == INPUT_MOUSE_MODE_NORMAL && (g_inputFlags & INPUT_FLAG_NO_CLICK) == 0) {
83 Input_HandleInput(Mouse_CheckButtons(newButtonState));
84 }
85
86 if (g_mouseMode != INPUT_MOUSE_MODE_PLAY && g_mouseLock == 0) {
87 Mouse_HandleMovement(newButtonState, mousePosX, mousePosY);
88 }
89 }
90}
91
92/**
93 * Set the region in which the mouse can move.

Callers 7

Video_Mouse_CallbackFunction · 0.85
Video_Mouse_CallbackFunction · 0.85
Video_TickFunction · 0.85
Mouse_HandlerFunction · 0.85
Video_TickFunction · 0.85
Video_Mouse_CallbackFunction · 0.85
Video_TickFunction · 0.85

Calls 3

Input_HandleInputFunction · 0.85
Mouse_CheckButtonsFunction · 0.85
Mouse_HandleMovementFunction · 0.85

Tested by

no test coverage detected