diff --git a/include/QF/keys.h b/include/QF/keys.h index c5768ec07..235e66489 100644 --- a/include/QF/keys.h +++ b/include/QF/keys.h @@ -348,6 +348,31 @@ typedef enum { QFM_WHEEL_DOWN, QFM_BUTTON6, QFM_BUTTON7, + QFM_BUTTON8, + QFM_BUTTON9, + QFM_BUTTON10, + QFM_BUTTON11, + QFM_BUTTON12, + QFM_BUTTON13, + QFM_BUTTON14, + QFM_BUTTON15, + QFM_BUTTON16, + QFM_BUTTON17, + QFM_BUTTON18, + QFM_BUTTON19, + QFM_BUTTON20, + QFM_BUTTON21, + QFM_BUTTON22, + QFM_BUTTON23, + QFM_BUTTON24, + QFM_BUTTON25, + QFM_BUTTON26, + QFM_BUTTON27, + QFM_BUTTON28, + QFM_BUTTON29, + QFM_BUTTON30, + QFM_BUTTON31, + QFM_BUTTON32, // // joystick buttons diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index 52b60dfc5..6b0c4d00f 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -618,21 +618,19 @@ event_key (XEvent *event) static void event_button (XEvent *event) { - int but; + unsigned but; x_time = event->xbutton.time; but = event->xbutton.button; + if (but > 32) + return; if (but == 2) but = 3; else if (but == 3) but = 2; switch (but) { - case 1: - case 2: - case 3: - case 6: - case 7: + default: Key_Event (QFM_BUTTON1 + but - 1, 0, event->type == ButtonPress); break; case 4: diff --git a/libs/video/targets/keys.c b/libs/video/targets/keys.c index 04d6b7918..1a6f3ceb5 100644 --- a/libs/video/targets/keys.c +++ b/libs/video/targets/keys.c @@ -393,6 +393,31 @@ keyname_t keynames[] = { { "M_WHEEL_DOWN", QFM_WHEEL_DOWN }, { "M_BUTTON6", QFM_BUTTON6 }, { "M_BUTTON7", QFM_BUTTON7 }, + { "M_BUTTON8", QFM_BUTTON8 }, + { "M_BUTTON9", QFM_BUTTON9 }, + { "M_BUTTON10", QFM_BUTTON10 }, + { "M_BUTTON11", QFM_BUTTON11 }, + { "M_BUTTON12", QFM_BUTTON12 }, + { "M_BUTTON13", QFM_BUTTON13 }, + { "M_BUTTON14", QFM_BUTTON14 }, + { "M_BUTTON15", QFM_BUTTON15 }, + { "M_BUTTON16", QFM_BUTTON16 }, + { "M_BUTTON17", QFM_BUTTON17 }, + { "M_BUTTON18", QFM_BUTTON18 }, + { "M_BUTTON19", QFM_BUTTON19 }, + { "M_BUTTON20", QFM_BUTTON20 }, + { "M_BUTTON21", QFM_BUTTON21 }, + { "M_BUTTON22", QFM_BUTTON22 }, + { "M_BUTTON23", QFM_BUTTON23 }, + { "M_BUTTON24", QFM_BUTTON24 }, + { "M_BUTTON25", QFM_BUTTON25 }, + { "M_BUTTON26", QFM_BUTTON26 }, + { "M_BUTTON27", QFM_BUTTON27 }, + { "M_BUTTON28", QFM_BUTTON28 }, + { "M_BUTTON29", QFM_BUTTON29 }, + { "M_BUTTON30", QFM_BUTTON30 }, + { "M_BUTTON31", QFM_BUTTON31 }, + { "M_BUTTON32", QFM_BUTTON32 }, { "J_BUTTON1", QFJ_BUTTON1 }, { "J_BUTTON2", QFJ_BUTTON2 },