{"MOUSE1", K_MOUSE1},
{"MOUSE2", K_MOUSE2},
{"MOUSE3", K_MOUSE3},
+ // LordHavoc: thanks to backslash for this MOUSE4 and MOUSE5 code
+ /* backslash :: imouse explorer buttons */
+ {"MOUSE4", K_MOUSE4},
+ {"MOUSE5", K_MOUSE5},
+ /* :: backslash */
+ // LordHavoc: added more for completeness
+ {"MOUSE6", K_MOUSE6},
+ {"MOUSE7", K_MOUSE7},
+ {"MOUSE8", K_MOUSE8},
+ {"MOUSE9", K_MOUSE9},
+ {"MOUSE10", K_MOUSE10},
{"JOY1", K_JOY1},
{"JOY2", K_JOY2},
#define K_PAUSE 255
-//
-// mouse buttons generate virtual keys
-//
-#define K_MOUSE1 200
-#define K_MOUSE2 201
-#define K_MOUSE3 202
-
//
// joystick buttons
//
#define K_MWHEELDOWN 239
#define K_MWHEELUP 240
+//
+// mouse buttons generate virtual keys
+//
+#define K_MOUSE1 241
+#define K_MOUSE2 242
+#define K_MOUSE3 243
+// LordHavoc: thanks to backslash for this MOUSE4 and MOUSE5 code,
+// LordHavoc: however I renumbered it differently and added MOUSE6 through MOUSE10
+/* backslash :: imouse explorer buttons */
+#define K_MOUSE4 244
+#define K_MOUSE5 245
+/* backslash :: renumber everything that follows so that the mouse4/5 buttons can be squeezed in */
+// LordHavoc: added these for completeness
+#define K_MOUSE6 246
+#define K_MOUSE7 247
+#define K_MOUSE8 248
+#define K_MOUSE9 249
+#define K_MOUSE10 250
+
+
extern char *keybindings[256];
extern int key_repeats[256];
case 5:
Key_Event(K_MWHEELDOWN, true);
break;
+ case 6:
+ Key_Event(K_MOUSE4, true);
+ break;
+ case 7:
+ Key_Event(K_MOUSE5, true);
+ break;
+ case 8:
+ Key_Event(K_MOUSE6, true);
+ break;
+ case 9:
+ Key_Event(K_MOUSE7, true);
+ break;
+ case 10:
+ Key_Event(K_MOUSE8, true);
+ break;
+ case 11:
+ Key_Event(K_MOUSE9, true);
+ break;
+ case 12:
+ Key_Event(K_MOUSE10, true);
+ break;
default:
- Con_Printf("HandleEvents: ButtonPress gave value %d, 1-5 expected\n", event.xbutton.button);
+ Con_Printf("HandleEvents: ButtonPress gave value %d, 1-12 expected\n", event.xbutton.button);
break;
}
break;
case 5:
Key_Event(K_MWHEELDOWN, false);
break;
+ case 6:
+ Key_Event(K_MOUSE4, false);
+ break;
+ case 7:
+ Key_Event(K_MOUSE5, false);
+ break;
+ case 8:
+ Key_Event(K_MOUSE6, false);
+ break;
+ case 9:
+ Key_Event(K_MOUSE7, false);
+ break;
+ case 10:
+ Key_Event(K_MOUSE8, false);
+ break;
+ case 11:
+ Key_Event(K_MOUSE9, false);
+ break;
+ case 12:
+ Key_Event(K_MOUSE10, false);
+ break;
default:
- Con_Printf("HandleEvents: ButtonRelease gave value %d, 1-5 expected\n", event.xbutton.button);
+ Con_Printf("HandleEvents: ButtonRelease gave value %d, 1-12 expected\n", event.xbutton.button);
break;
}
break;
HRESULT (WINAPI *pDirectInputCreate)(HINSTANCE hinst, DWORD dwVersion,
LPDIRECTINPUT * lplpDirectInput, LPUNKNOWN punkOuter);
+// LordHavoc: thanks to backslash for this support for mouse buttons 4 and 5
+/* backslash :: imouse explorer buttons */
+/* These are #ifdefed out for non-Win2K in the February 2001 version of
+ MS's platform SDK, but we need them for compilation. . . */
+#ifndef WM_XBUTTONDOWN
+ #define WM_XBUTTONDOWN 0x020B
+ #define WM_XBUTTONUP 0x020C
+#endif
+#ifndef MK_XBUTTON1
+ #define MK_XBUTTON1 0x0020
+ #define MK_XBUTTON2 0x0040
+// LordHavoc: lets hope this allows more buttons in the future...
+ #define MK_XBUTTON3 0x0080
+ #define MK_XBUTTON4 0x0100
+ #define MK_XBUTTON5 0x0200
+ #define MK_XBUTTON6 0x0400
+ #define MK_XBUTTON7 0x0800
+#endif
+/* :: backslash */
+
// mouse variables
int mouse_buttons;
int mouse_oldbuttonstate;
case WM_RBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
+ case WM_XBUTTONDOWN: // backslash :: imouse explorer buttons
+ case WM_XBUTTONUP: // backslash :: imouse explorer buttons
case WM_MOUSEMOVE:
temp = 0;
if (wParam & MK_MBUTTON)
temp |= 4;
+ /* backslash :: imouse explorer buttons */
+ if (wParam & MK_XBUTTON1)
+ temp |= 8;
+
+ if (wParam & MK_XBUTTON2)
+ temp |= 16;
+ /* :: backslash */
+
+ // LordHavoc: lets hope this allows more buttons in the future...
+ if (wParam & MK_XBUTTON3)
+ temp |= 32;
+ if (wParam & MK_XBUTTON4)
+ temp |= 64;
+ if (wParam & MK_XBUTTON5)
+ temp |= 128;
+ if (wParam & MK_XBUTTON6)
+ temp |= 256;
+ if (wParam & MK_XBUTTON7)
+ temp |= 512;
+
IN_MouseEvent (temp);
break;
}
}
- mouse_buttons = 3;
+ mouse_buttons = 10;
// if a fullscreen video mode was set before the mouse was initialized,
// set the mouse state appropriately