mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[x11] Remove the magic number for mouse buttons
The current limit is still 32. Dealing with it properly will take some rather advanced messing with XInput, and will be necessary assuming non-XInput support is continued.
This commit is contained in:
parent
26a1f66b4e
commit
4944c40f86
1 changed files with 5 additions and 3 deletions
|
@ -92,12 +92,13 @@ typedef struct x11_device_s {
|
|||
int devid;
|
||||
} x11_device_t;
|
||||
|
||||
#define X11_MOUSE_BUTTONS 32
|
||||
// The X11 protocol supports only 256 keys
|
||||
static in_buttoninfo_t x11_key_buttons[256];
|
||||
// X11 mice have only two axes (FIXME always true?)
|
||||
static in_axisinfo_t x11_mouse_axes[2];
|
||||
// FIXME assume up to 32 mouse buttons
|
||||
static in_buttoninfo_t x11_mouse_buttons[32];
|
||||
// FIXME assume up to 32 mouse buttons (see X11_MOUSE_BUTTONS)
|
||||
static in_buttoninfo_t x11_mouse_buttons[X11_MOUSE_BUTTONS];
|
||||
static const char *x11_mouse_axis_names[] = {"M_X", "M_Y"};
|
||||
static const char *x11_mouse_button_names[] = {
|
||||
"M_BUTTON1", "M_BUTTON2", "M_BUTTON3", "M_WHEEL_UP",
|
||||
|
@ -787,8 +788,9 @@ event_button (XEvent *event)
|
|||
|
||||
x_time = event->xbutton.time;
|
||||
|
||||
// x11 buttons are 1-based
|
||||
but = event->xbutton.button - 1;
|
||||
if (but >= 32) {
|
||||
if (but > X11_MOUSE_BUTTONS) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue