2013-03-03 23:50:38 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-04-26 15:39:46 +00:00
|
|
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2013-2014 - Jason Fetters
|
2013-03-03 23:50:38 +00:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-07-07 20:01:58 +00:00
|
|
|
#ifndef __APPLE_RARCH_INPUT_H__
|
|
|
|
#define __APPLE_RARCH_INPUT_H__
|
2013-03-20 01:36:34 +00:00
|
|
|
|
2014-04-26 15:39:46 +00:00
|
|
|
#include "../general.h"
|
2014-10-04 21:02:48 +00:00
|
|
|
#include "connect/joypad_connection.h"
|
2013-10-03 21:43:41 +00:00
|
|
|
|
2014-09-02 14:50:28 +00:00
|
|
|
/* Input responder */
|
2013-03-03 23:50:38 +00:00
|
|
|
#define MAX_TOUCHES 16
|
|
|
|
#define MAX_KEYS 256
|
|
|
|
|
2014-09-30 13:03:22 +00:00
|
|
|
#ifndef NUM_HATS
|
|
|
|
#define NUM_HATS 4
|
|
|
|
#endif
|
|
|
|
|
2013-04-04 17:06:32 +00:00
|
|
|
typedef struct
|
2013-03-03 23:50:38 +00:00
|
|
|
{
|
|
|
|
int16_t screen_x, screen_y;
|
|
|
|
int16_t fixed_x, fixed_y;
|
|
|
|
int16_t full_x, full_y;
|
2013-07-07 20:01:58 +00:00
|
|
|
} apple_touch_data_t;
|
2013-03-03 23:50:38 +00:00
|
|
|
|
2013-04-04 17:06:32 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2013-07-07 20:01:58 +00:00
|
|
|
apple_touch_data_t touches[MAX_TOUCHES];
|
2013-04-04 17:06:32 +00:00
|
|
|
uint32_t touch_count;
|
|
|
|
|
2013-08-11 04:20:15 +00:00
|
|
|
uint32_t mouse_buttons;
|
|
|
|
int16_t mouse_delta[2];
|
|
|
|
|
2013-04-04 17:06:32 +00:00
|
|
|
uint32_t keys[MAX_KEYS];
|
|
|
|
|
2014-09-30 13:03:22 +00:00
|
|
|
uint32_t buttons[MAX_PLAYERS];
|
|
|
|
int16_t axes[MAX_PLAYERS][4];
|
|
|
|
int8_t hats[NUM_HATS][2];
|
2014-09-30 13:44:40 +00:00
|
|
|
|
|
|
|
const rarch_joypad_driver_t *joypad;
|
2013-07-07 20:01:58 +00:00
|
|
|
} apple_input_data_t;
|
2013-04-04 17:06:32 +00:00
|
|
|
|
2013-07-07 20:01:58 +00:00
|
|
|
void apple_input_enable_icade(bool on);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
2014-01-16 03:14:58 +00:00
|
|
|
void apple_input_enable_small_keyboard(bool on);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
2013-11-22 14:30:02 +00:00
|
|
|
uint32_t apple_input_get_icade_buttons(void);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
2013-11-22 14:30:02 +00:00
|
|
|
void apple_input_reset_icade_buttons(void);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
|
|
|
void apple_input_keyboard_event(bool down, unsigned code,
|
|
|
|
uint32_t character, uint32_t mod);
|
2013-03-20 01:36:34 +00:00
|
|
|
|
2013-11-22 14:30:02 +00:00
|
|
|
extern int32_t apple_input_find_any_key(void);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
2013-09-09 21:52:02 +00:00
|
|
|
extern int32_t apple_input_find_any_button(uint32_t port);
|
2014-09-02 14:50:28 +00:00
|
|
|
|
2013-09-09 21:52:02 +00:00
|
|
|
extern int32_t apple_input_find_any_axis(uint32_t port);
|
|
|
|
|
2013-03-30 00:00:42 +00:00
|
|
|
#endif
|