- if( event.button.button == SDL_BUTTON_MIDDLE )
- event.button.button = SDL_BUTTON_RIGHT;
- else if( event.button.button == SDL_BUTTON_RIGHT )
- event.button.button = SDL_BUTTON_MIDDLE;
- Key_Event( K_MOUSE1 + event.button.button - 1, 0, false );
+ if (event.button.button <= 18)
+ Key_Event( buttonremap[event.button.button - 1], 0, false );