MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / onMouseWheel

Function onMouseWheel

source/kernel/devs/devinput.cpp:748–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

746}
747
748void onMouseWheel(S32 value) {
749 if (!touchEvents) {
750 return;
751 }
752 U64 time = KSystem::getSystemTimeAsMicroSeconds();
753 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(touchEvents->bufferCond);
754
755 // Up direction (y > 0)
756 if (value > 0) {
757 // Mouse wheel cannot really be held down so the 'up' event is sent, too
758 queueEvent(touchEvents, K_EV_KEY, K_BTN_MOUSEWHEEL_UP, value, time);
759 queueEvent(touchEvents, K_EV_KEY, K_BTN_MOUSEWHEEL_UP, 0, time);
760 }
761 // Down direction
762 else if (value < 0) {
763 queueEvent(touchEvents, K_EV_KEY, K_BTN_MOUSEWHEEL_DOWN, -value, time);
764 queueEvent(touchEvents, K_EV_KEY, K_BTN_MOUSEWHEEL_DOWN, 0, time);
765 }
766 else
767 return;
768
769 postSendEvent(touchEvents, time);
770 BOXEDWINE_CONDITION_SIGNAL_ALL(touchEvents->bufferCond);
771}
772
773void onMouseMove(U32 x, U32 y, bool relative) {
774 U32 send = 0;

Callers 1

handlSdlEventMethod · 0.85

Calls 2

queueEventFunction · 0.85
postSendEventFunction · 0.85

Tested by

no test coverage detected