#include "network.h"
-#define DEBUG_EVENTS 0
+#define DEBUG_EVENTS 1
+
+#define DEBUG_EVENTS_BUTTON (DEBUG_EVENTS * 0)
+#define DEBUG_EVENTS_MOTION (DEBUG_EVENTS * 0)
+#define DEBUG_EVENTS_WINDOW (DEBUG_EVENTS * 0)
+#define DEBUG_EVENTS_FINGER (DEBUG_EVENTS * 0)
+#define DEBUG_EVENTS_TEXT (DEBUG_EVENTS * 1)
+#define DEBUG_EVENTS_KEY (DEBUG_EVENTS * 1)
static boolean cursor_inside_playfield = FALSE;
void HandleButtonEvent(ButtonEvent *event)
{
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_BUTTON
Error(ERR_DEBUG, "BUTTON EVENT: button %d %s, x/y %d/%d\n",
event->button,
event->type == EVENT_BUTTONPRESS ? "pressed" : "released",
motion_status = TRUE;
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_MOTION
Error(ERR_DEBUG, "MOTION EVENT: button %d moved, x/y %d/%d\n",
button_status, event->x, event->y);
#endif
void HandleWindowEvent(WindowEvent *event)
{
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_WINDOW
int subtype = event->event;
char *event_name =
float event_x = event->x;
float event_y = event->y;
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_FINGER
Error(ERR_DEBUG, "FINGER EVENT: finger was %s, touch ID %lld, finger ID %lld, x/y %f/%f, dx/dy %f/%f, pressure %f",
event->type == EVENT_FINGERPRESS ? "pressed" :
event->type == EVENT_FINGERRELEASE ? "released" : "moved",
char *text = event->text;
Key key = getKeyFromKeyName(text);
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_TEXT
Error(ERR_DEBUG, "TEXT EVENT: text == '%s' [%d byte(s), '%c'/%d], resulting key == %d (%s) [%04x]",
text,
strlen(text),
GetKeyModState());
#endif
+#if defined(PLATFORM_ANDROID)
+ if (game_status == GAME_MODE_PSEUDO_TYPENAME)
+ {
+ HandleTypeName(0, key);
+
+ return;
+ }
+#endif
+
// if (game_status != GAME_MODE_PLAYING && GetKeyModState() != KMOD_None)
/*
if (game_status != GAME_MODE_PLAYING &&
Key key = GetEventKey(event, with_modifiers);
Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key);
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_KEY
Error(ERR_DEBUG, "KEY EVENT: key was %s, keysym.scancode == %d, keysym.sym == %d, keymod = %d, GetKeyModState() = 0x%04x, resulting key == %d (%s)",
event->type == EVENT_KEYPRESS ? "pressed" : "released",
event->keysym.scancode,
cheat_input[cheat_input_len++] = letter;
cheat_input[cheat_input_len] = '\0';
-#if DEBUG_EVENTS
+#if DEBUG_EVENTS_KEY
Error(ERR_DEBUG, "SPECIAL KEY '%s' [%d]\n", cheat_input, cheat_input_len);
#endif
strcpy(last_player_name, setup.player_name);
xpos = newxpos;
+
+#if defined(TARGET_SDL2)
+ SDL_StartTextInput();
+#endif
}
else if (is_valid_key_char && xpos < MAX_PLAYER_NAME_LEN)
{
startx = mSX + ALIGNED_TEXT_XPOS(pos);
DrawText(startx, starty, setup.player_name, font_nr);
+
+#if defined(TARGET_SDL2)
+ SDL_StopTextInput();
+#endif
}
}
DrawSetupScreen();
}
+#if !defined(PLATFORM_ANDROID)
static void execSetupInput()
{
setup_mode = SETUP_MODE_INPUT;
DrawSetupScreen();
}
+#endif
static void execSetupShortcuts()
{