|
mouse button 4 and 5?
#453583
08/02/15 11:18
08/02/15 11:18
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi,
Is it possible to set a function for other mouse buttons besides left, right and middle (so besides on_mouse_left, on_mouse_right, on_mouse_middle)?
Some mouses have e.g. 2 extra buttons, would be nice to make use of them for shortcuts / hotkeys.
Last edited by Reconnoiter; 08/02/15 11:47.
|
|
|
Re: mouse button 4 and 5?
[Re: Reconnoiter]
#453586
08/02/15 15:43
08/02/15 15:43
|
Malice
Unregistered
|
Malice
Unregistered
|
No other buttons are in the manuals key map, try find the scan code for the buttons and writing your own check with key_pressed(scancodeX)
|
|
|
Re: mouse button 4 and 5?
[Re: Reconnoiter]
#453601
08/02/15 20:01
08/02/15 20:01
|
Malice
Unregistered
|
Malice
Unregistered
|
If that doesn't work... You need to jump out of the 3dgs and into the winapi to achieve the goal. There are a many people here that could speak on that, I am not one of them.
|
|
|
Re: mouse button 4 and 5?
[Re: Reconnoiter]
#453610
08/03/15 18:54
08/03/15 18:54
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I've got a code snippet, I'll see if I can find it. Edit: here:
#define mouse_4 (GetKeyState(5) > 1)
#define mouse_5 (GetKeyState(6) > 1)
Tiny but works. but remember to include windows.h. Edit2: forgot to say: you can use it exactly like the vars mouse_left, mouse_right, etc.
Last edited by Kartoffel; 08/03/15 19:00. Reason: typos
POTATO-MAN saves the day! - Random
|
|
|
Re: mouse button 4 and 5?
[Re: Ch40zzC0d3r]
#453615
08/03/15 20:48
08/03/15 20:48
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Yeah, there are two bits used. One for pressed/not pressed and one as a button toggle (pressing the key switches between on and off)
POTATO-MAN saves the day! - Random
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|