diff --git a/src/Input.c b/src/Input.c index cc4235af9..c49bb8896 100644 --- a/src/Input.c +++ b/src/Input.c @@ -216,7 +216,8 @@ static const char* const storageNames[INPUT_COUNT] = { "Keypad5", "Keypad6", "Keypad7", "Keypad8", "Keypad9", "KeypadDivide", "KeypadMultiply", "KeypadSubtract", "KeypadAdd", "KeypadDecimal", "KeypadEnter", - "XButton1", "XButton2", "LeftMouse", "RightMouse", "MiddleMouse", + "XButton1", "XButton2", "XButton3", "XButton4", "XButton5", "XButton6", + "LeftMouse", "RightMouse", "MiddleMouse", Pad_Names }; @@ -239,7 +240,8 @@ const char* const Input_DisplayNames[INPUT_COUNT] = { "NUMPAD5", "NUMPAD6", "NUMPAD7", "NUMPAD8", "NUMPAD9", "DIVIDE", "MULTIPLY", "SUBTRACT", "ADD", "DECIMAL", "NUMPADENTER", - "XBUTTON1", "XBUTTON2", "LMOUSE", "RMOUSE", "MMOUSE", + "XBUTTON1", "XBUTTON2", "XBUTTON3", "XBUTTON4", "XBUTTON5", "XBUTTON6", + "LMOUSE", "RMOUSE", "MMOUSE", Pad_Names }; diff --git a/src/Input.h b/src/Input.h index 35fff1e2b..d24f778a5 100644 --- a/src/Input.h +++ b/src/Input.h @@ -43,7 +43,8 @@ enum InputButtons { CCKEY_KP_PLUS, CCKEY_KP_DECIMAL, CCKEY_KP_ENTER, /* NOTE: RMOUSE must be before MMOUSE for PlayerClick compatibility */ - CCMOUSE_X1, CCMOUSE_X2, CCMOUSE_L, CCMOUSE_R, CCMOUSE_M, + CCMOUSE_X1, CCMOUSE_X2, CCMOUSE_X3, CCMOUSE_X4, CCMOUSE_X5, CCMOUSE_X6, + CCMOUSE_L, CCMOUSE_R, CCMOUSE_M, CCPAD_A, CCPAD_B, CCPAD_X, CCPAD_Y, CCPAD_L, CCPAD_R, CCPAD_Z, CCPAD_LEFT, CCPAD_RIGHT, CCPAD_UP, CCPAD_DOWN, diff --git a/src/Window_X11.c b/src/Window_X11.c index 0c55e075d..bab0f3756 100644 --- a/src/Window_X11.c +++ b/src/Window_X11.c @@ -474,8 +474,17 @@ static int MapNativeMouse(int button) { if (button == 1) return CCMOUSE_L; if (button == 2) return CCMOUSE_M; if (button == 3) return CCMOUSE_R; - if (button == 8) return CCMOUSE_X1; - if (button == 9) return CCMOUSE_X2; + + if (button == 8) return CCMOUSE_X1; + if (button == 9) return CCMOUSE_X2; + if (button == 10) return CCMOUSE_X3; + if (button == 11) return CCMOUSE_X4; + if (button == 12) return CCMOUSE_X5; + if (button == 13) return CCMOUSE_X6; + + /* Mouse horizontal and vertical scroll */ + if (button >= 4 && button <= 7) return 0; + Platform_Log1("Unknown mouse button: %i", &button); return 0; } diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index 7e1b36ba9..10c32a1f3 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -434,8 +434,15 @@ static int MapNativeMouse(long button) { if (button == 0) return CCMOUSE_L; if (button == 1) return CCMOUSE_R; if (button == 2) return CCMOUSE_M; + if (button == 3) return CCMOUSE_X1; if (button == 4) return CCMOUSE_X2; + if (button == 5) return CCMOUSE_X3; + if (button == 6) return CCMOUSE_X4; + if (button == 7) return CCMOUSE_X5; + if (button == 8) return CCMOUSE_X6; + + Platform_Log1("Unknown mouse button: %i", &button); return 0; }