I am aware of how to use mouse_event to simulate a mouse click for the left or right buttons. What I would like to know is if this function or another in C#/C++ allows you to simulate the mouse4 or mouse5 buttons that gaming mice have?
Step 2 Move the mouse pointer left and right by pressing “4” and “6” on the numeric keypad. Press “8” and “2” to move the pointer up or down. The “1”, “3”, “7” and “9” keys move the mouse pointer diagonally. Step 3 Simulate a left mouse click by pressing “5." Press “+” to double-click.
Many new computer mice also have buttons on the side of the mouse. These buttons can be programmed to do anything. However, by default, the left-thumb button can go back on a web page.
mouse4
and mouse5
in windows are named xbutton1
and xbutton2
You can use these:
mouse_event(MOUSEEVENTF_XDOWN, NULL, NULL, XBUTTON1, NULL);
mouse_event(MOUSEEVENTF_XDOWN, NULL, NULL, XBUTTON2, NULL);
mouse_event(MOUSEEVENTF_XUP, NULL, NULL, XBUTTON1, NULL);
mouse_event(MOUSEEVENTF_XUP, NULL, NULL, XBUTTON2, NULL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With