MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / scrollWheelUpdate

Method scrollWheelUpdate

olcPixelGameEngine.h:7346–7363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7344
7345#if defined(__APPLE__)
7346 static void scrollWheelUpdate(id selff, SEL _sel, id theEvent) {
7347 static const SEL deltaYSel = sel_registerName("deltaY");
7348
7349#if defined(__aarch64__) // Thanks ruarq!
7350 double deltaY = ((double (*)(id, SEL))objc_msgSend)(theEvent, deltaYSel);
7351#else
7352 double deltaY = ((double (*)(id, SEL))objc_msgSend_fpret)(theEvent, deltaYSel);
7353#endif
7354
7355 for (int i = 0; i < abs(deltaY); i++) {
7356 if (deltaY > 0) {
7357 ptrPGE->olc_UpdateMouseWheel(-1);
7358 }
7359 else if (deltaY < 0) {
7360 ptrPGE->olc_UpdateMouseWheel(1);
7361 }
7362 }
7363 }
7364#endif
7365 static void ThreadFunct() {
7366#if defined(__APPLE__)

Callers

nothing calls this directly

Calls 1

olc_UpdateMouseWheelMethod · 0.80

Tested by

no test coverage detected