mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Revert "Revert "Refactor small keyboard/icade code a bit""
This reverts commit fde9676ac315cec16aa7fb58c79526b07fa8b5dd.
This commit is contained in:
parent
ba00560f2b
commit
924642a744
@ -126,26 +126,6 @@ const struct apple_key_name_map_entry apple_key_name_map[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
void cocoa_input_enable_small_keyboard(bool on)
|
|
||||||
{
|
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)driver->input_data;
|
|
||||||
if (apple)
|
|
||||||
apple->small_keyboard_enabled = on;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cocoa_input_enable_icade(bool on)
|
|
||||||
{
|
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)driver->input_data;
|
|
||||||
|
|
||||||
if (!apple)
|
|
||||||
return;
|
|
||||||
|
|
||||||
apple->icade_enabled = on;
|
|
||||||
apple->icade_buttons = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cocoa_input_reset_icade_buttons(void)
|
void cocoa_input_reset_icade_buttons(void)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
@ -178,9 +158,10 @@ int32_t cocoa_input_find_any_key(void)
|
|||||||
static int cocoa_input_find_any_button_ret(cocoa_input_data_t *apple,
|
static int cocoa_input_find_any_button_ret(cocoa_input_data_t *apple,
|
||||||
unsigned buttons, unsigned port)
|
unsigned buttons, unsigned port)
|
||||||
{
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned i;
|
unsigned i;
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
if (port == 0 && apple->icade_enabled)
|
if (port == 0 && settings->input.icade_enable)
|
||||||
BIT32_SET(buttons, apple->icade_buttons);
|
BIT32_SET(buttons, apple->icade_buttons);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -267,6 +248,7 @@ static void *cocoa_input_init(void)
|
|||||||
static void cocoa_input_poll(void *data)
|
static void cocoa_input_poll(void *data)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
||||||
|
|
||||||
for (i = 0; i < apple->touch_count; i++)
|
for (i = 0; i < apple->touch_count; i++)
|
||||||
@ -282,7 +264,7 @@ static void cocoa_input_poll(void *data)
|
|||||||
apple->joypad->poll();
|
apple->joypad->poll();
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
if (apple->icade_enabled)
|
if (settings->input.icade_enable)
|
||||||
BIT32_SET(apple->buttons[0], apple->icade_buttons);
|
BIT32_SET(apple->buttons[0], apple->icade_buttons);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -60,9 +60,6 @@ typedef struct
|
|||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
uint32_t mfi_buttons[MAX_USERS];
|
uint32_t mfi_buttons[MAX_USERS];
|
||||||
|
|
||||||
bool icade_enabled;
|
|
||||||
bool small_keyboard_enabled;
|
|
||||||
bool small_keyboard_active;
|
bool small_keyboard_active;
|
||||||
uint32_t icade_buttons;
|
uint32_t icade_buttons;
|
||||||
#endif
|
#endif
|
||||||
@ -71,10 +68,6 @@ typedef struct
|
|||||||
} cocoa_input_data_t;
|
} cocoa_input_data_t;
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
void cocoa_input_enable_icade(bool on);
|
|
||||||
|
|
||||||
void cocoa_input_enable_small_keyboard(bool on);
|
|
||||||
|
|
||||||
void cocoa_input_reset_icade_buttons(void);
|
void cocoa_input_reset_icade_buttons(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -142,6 +142,7 @@ void cocoa_input_keyboard_event(bool down,
|
|||||||
unsigned code, uint32_t character, uint32_t mod, unsigned device)
|
unsigned code, uint32_t character, uint32_t mod, unsigned device)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)driver->input_data;
|
cocoa_input_data_t *apple = (cocoa_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
@ -150,14 +151,16 @@ void cocoa_input_keyboard_event(bool down,
|
|||||||
code = HIDKEY(code);
|
code = HIDKEY(code);
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
if (apple->icade_enabled)
|
if (settings->input.icade_enable)
|
||||||
{
|
{
|
||||||
handle_icade_event(code);
|
handle_icade_event(code);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (apple->small_keyboard_enabled &&
|
else if (settings->input.small_keyboard_enable)
|
||||||
handle_small_keyboard(&code, down))
|
{
|
||||||
character = 0;
|
if (handle_small_keyboard(&code, down))
|
||||||
|
character = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (code == 0 || code >= MAX_KEYS)
|
if (code == 0 || code >= MAX_KEYS)
|
||||||
|
@ -390,7 +390,6 @@ enum
|
|||||||
|
|
||||||
- (void)refreshSystemConfig
|
- (void)refreshSystemConfig
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
bool is_btstack;
|
bool is_btstack;
|
||||||
|
|
||||||
/* Get enabled orientations */
|
/* Get enabled orientations */
|
||||||
@ -404,8 +403,6 @@ enum
|
|||||||
/* Set bluetooth mode */
|
/* Set bluetooth mode */
|
||||||
is_btstack = !(strcmp(apple_frontend_settings.bluetooth_mode, "btstack"));
|
is_btstack = !(strcmp(apple_frontend_settings.bluetooth_mode, "btstack"));
|
||||||
|
|
||||||
cocoa_input_enable_small_keyboard(settings->input.small_keyboard_enable);
|
|
||||||
cocoa_input_enable_icade(settings->input.icade_enable);
|
|
||||||
btstack_set_poweron(is_btstack);
|
btstack_set_poweron(is_btstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user