{
MotionEvent *motion;
-#if defined(TARGET_SDL2)
// skip repeated key press events if keyboard auto-repeat is disabled
if (event->type == EVENT_KEYPRESS &&
event->key.repeat &&
!keyrepeat_status)
return 0;
-#endif
if (event->type == EVENT_BUTTONPRESS ||
event->type == EVENT_BUTTONRELEASE)
HandleMotionEvent((MotionEvent *) &event);
break;
-#if defined(TARGET_SDL2)
case EVENT_WHEELMOTION:
HandleWheelEvent((WheelEvent *) &event);
break;
case SDL_APP_DIDENTERFOREGROUND:
HandlePauseResumeEvent((PauseResumeEvent *) &event);
break;
-#endif
case EVENT_KEYPRESS:
case EVENT_KEYRELEASE:
HandleClientMessageEvent((ClientMessageEvent *) event);
break;
-#if defined(TARGET_SDL)
-#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONDOWN:
case SDL_CONTROLLERBUTTONUP:
// for any game controller button event, disable overlay buttons
case SDL_CONTROLLERDEVICEADDED:
case SDL_CONTROLLERDEVICEREMOVED:
case SDL_CONTROLLERAXISMOTION:
-#endif
case SDL_JOYAXISMOTION:
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
case SDL_SYSWMEVENT:
HandleWindowManagerEvent(event);
break;
-#endif
default:
break;
void ClearAutoRepeatKeyEvents(void)
{
-#if defined(TARGET_SDL2)
while (PendingEvent())
{
Event next_event;
else
break;
}
-#endif
}
void ClearEventQueue(void)
ClearPlayerAction();
break;
-#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONUP:
HandleJoystickEvent(&event);
ClearPlayerAction();
break;
-#endif
default:
HandleOtherEvents(&event);
key_joystick_mapping = 0;
break;
-#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONUP:
HandleJoystickEvent(&event);
key_joystick_mapping = 0;
break;
-#endif
case EVENT_MAPNOTIFY:
window_unmapped = FALSE;
HandleButton(event->x, event->y, button_status, button_status);
}
-#if defined(TARGET_SDL2)
-
void HandleWheelEvent(WheelEvent *event)
{
int button_nr;
HandleFingerEvent_WipeGestures(event);
}
-#endif
-
static void HandleButtonOrFinger_WipeGestures_MM(int mx, int my, int button)
{
static int old_mx = 0, old_my = 0;
}
}
-#if defined(TARGET_SDL2)
-
static boolean checkTextInputKeyModState(void)
{
// when playing, only handle raw key events and ignore text input
}
}
-#endif
-
void HandleKeyEvent(KeyEvent *event)
{
int key_status = (event->type == EVENT_KEYPRESS ? KEY_PRESSED : KEY_RELEASED);
HandleKeyModState(keymod, key_status);
-#if defined(TARGET_SDL2)
// only handle raw key input without text modifier keys pressed
if (!checkTextInputKeyModState())
HandleKey(key, key_status);
-#else
- HandleKey(key, key_status);
-#endif
}
void HandleFocusEvent(FocusChangeEvent *event)
void HandleWindowManagerEvent(Event *event)
{
-#if defined(TARGET_SDL)
SDLHandleWindowManagerEvent(event);
-#endif
}
void HandleButton(int mx, int my, int button, int button_nr)
{
DumpBrush_Small();
}
+
+ if (GetKeyModState() & (KMOD_Control | KMOD_Meta))
+ {
+ if (letter == 'x') // copy brush to clipboard (small size)
+ {
+ CopyBrushToClipboard_Small();
+ }
+ else if (letter == 'c') // copy brush to clipboard (normal size)
+ {
+ CopyBrushToClipboard();
+ }
+ else if (letter == 'v') // paste brush from Clipboard
+ {
+ CopyClipboardToBrush();
+ }
+ }
}
// special key shortcuts for all game modes
int joy = 0;
int i;
-#if defined(TARGET_SDL2)
// map special keys (media keys / remote control buttons) to default keys
if (key == KSYM_PlayPause)
key = KSYM_space;
else if (key == KSYM_Select)
key = KSYM_Return;
-#endif
HandleSpecialGameControllerKeys(key, key_status);
HandleKeysSpecial(key);
if (HandleGadgetsKeyInput(key))
- {
- if (key != KSYM_Escape) // always allow ESC key to be handled
- key = KSYM_UNDEFINED;
- }
+ return; // do not handle already processed keys again
switch (game_status)
{
void HandleSpecialGameControllerButtons(Event *event)
{
-#if defined(TARGET_SDL2)
int key_status;
Key key;
}
HandleKey(key, key_status);
-#endif
}
void HandleSpecialGameControllerKeys(Key key, int key_status)
{
-#if defined(TARGET_SDL2)
#if defined(KSYM_Rewind) && defined(KSYM_FastForward)
int button = SDL_CONTROLLER_BUTTON_INVALID;
HandleJoystickEvent(&event);
}
#endif
-#endif
}
boolean DoKeysymAction(int keysym)