Ejemplo n.º 1
0
int32_t apple_input_find_any_key(void)
{
   unsigned i;

#ifdef IOS
   apple_gamecontroller_poll_all();
#endif
   input_init_keyboard_lut(apple_key_map_hidusage);

   for (i = 0; apple_key_name_map[i].hid_id; i++)
      if (g_current_input_data.keys[apple_key_name_map[i].hid_id])
         return apple_key_name_map[i].hid_id;

   return 0;
}
Ejemplo n.º 2
0
int32_t apple_input_find_any_axis(uint32_t port)
{
#ifdef IOS
   apple_gamecontroller_poll_all();
#endif

   for (int i = 0; i < 4; i++)
   {
      int16_t value = g_current_input_data.pad_axis[port][i];
      
      if (abs(value) > 0x4000)
         return (value < 0) ? -(i + 1) : i + 1;
   }

   return 0;
}
Ejemplo n.º 3
0
int32_t apple_input_find_any_button(uint32_t port)
{
   unsigned i, buttons;
#ifdef IOS
   apple_gamecontroller_poll_all();
#endif

   buttons = g_current_input_data.pad_buttons[port] |
      ((port == 0) ? apple_input_get_icade_buttons() : 0);

   if (buttons)
      for (i = 0; i != 32; i ++)
         if (buttons & (1 << i))
            return i;

   return -1;
}
Ejemplo n.º 4
0
static void apple_input_poll(void *data)
{
   int i;
   (void)data;

#ifdef IOS
   apple_gamecontroller_poll_all();
#endif

   for (i = 0; i < g_current_input_data.touch_count; i ++)
   {
      input_translate_coord_viewport(g_current_input_data.touches[i].screen_x, g_current_input_data.touches[i].screen_y,
         &g_current_input_data.touches[i].fixed_x, &g_current_input_data.touches[i].fixed_y,
         &g_current_input_data.touches[i].full_x, &g_current_input_data.touches[i].full_y);
   }

   input_joypad_poll(joypad);
   g_current_input_data.pad_buttons[0] |= apple_input_get_icade_buttons();

   g_current_input_data.mouse_delta[0] = 0;
   g_current_input_data.mouse_delta[1] = 0;
}
Ejemplo n.º 5
0
static void apple_joypad_poll(void)
{
    apple_gamecontroller_poll_all();
}