- in_keystate = actions[IN_BINDTYPE_PLAYER12];
-}
-#else /* MAEMO */
-#include <gtk/gtk.h>
-static void update_input(void)
-{
- extern int g_maemo_opts;
- extern int maemo_x11_update_keys();
- if (g_maemo_opts&8)
- maemo_x11_update_keys();
- else{
- /* process GTK+ events */
- while (gtk_events_pending())
- gtk_main_iteration();
+ in_keystate[0] = actions[IN_BINDTYPE_PLAYER12] & 0xffff;
+ in_keystate[1] = (actions[IN_BINDTYPE_PLAYER12] >> 16) & 0xffff;
+
+ if (tsdev) for (i = 0; i < 2; i++) {
+ int in = 0, x = 0, y = 0, trigger;;
+ if (in_type[i] != PSE_PAD_TYPE_GUN
+ && in_type[i] != PSE_PAD_TYPE_GUNCON)
+ continue;
+ trigger = in_type[i] == PSE_PAD_TYPE_GUN
+ ? (1 << DKEY_SQUARE) : (1 << DKEY_CIRCLE);
+
+ pl_gun_ts_update(tsdev, &x, &y, &in);
+ in_analog_left[i][0] = 65536;
+ in_analog_left[i][1] = 65536;
+ if (in && !(in_state_gun & (1 << SACTION_GUN_TRIGGER2))) {
+ in_analog_left[i][0] = x;
+ in_analog_left[i][1] = y;
+ if (!(g_opts & OPT_TSGUN_NOTRIGGER))
+ in_state_gun |= (1 << SACTION_GUN_TRIGGER);
+ }
+ in_keystate[i] = 0;
+ if (in_state_gun & ((1 << SACTION_GUN_TRIGGER)
+ | (1 << SACTION_GUN_TRIGGER2)))
+ in_keystate[i] |= trigger;
+ if (in_state_gun & (1 << SACTION_GUN_A))
+ in_keystate[i] |= (1 << DKEY_START);
+ if (in_state_gun & (1 << SACTION_GUN_B))
+ in_keystate[i] |= (1 << DKEY_CROSS);