MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / button_mouse

Function button_mouse

src/platform/windows/input.cpp:561–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559 }
560
561 void button_mouse(input_t &input, int button, bool release) {
562 INPUT i {};
563
564 i.type = INPUT_MOUSE;
565 auto &mi = i.mi;
566
567 if (button == 1) {
568 mi.dwFlags = release ? MOUSEEVENTF_LEFTUP : MOUSEEVENTF_LEFTDOWN;
569 } else if (button == 2) {
570 mi.dwFlags = release ? MOUSEEVENTF_MIDDLEUP : MOUSEEVENTF_MIDDLEDOWN;
571 } else if (button == 3) {
572 mi.dwFlags = release ? MOUSEEVENTF_RIGHTUP : MOUSEEVENTF_RIGHTDOWN;
573 } else if (button == 4) {
574 mi.dwFlags = release ? MOUSEEVENTF_XUP : MOUSEEVENTF_XDOWN;
575 mi.mouseData = XBUTTON1;
576 } else {
577 mi.dwFlags = release ? MOUSEEVENTF_XUP : MOUSEEVENTF_XDOWN;
578 mi.mouseData = XBUTTON2;
579 }
580
581 send_input(i);
582 }
583
584 void scroll(input_t &input, int distance) {
585 INPUT i {};

Callers

nothing calls this directly

Calls 1

send_inputFunction · 0.85

Tested by

no test coverage detected