mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
revert
This commit is contained in:
parent
63bf68d616
commit
269c902429
@ -52,7 +52,6 @@ typedef struct
|
|||||||
int16_t mouse_wd;
|
int16_t mouse_wd;
|
||||||
int16_t mouse_wl;
|
int16_t mouse_wl;
|
||||||
int16_t mouse_wr;
|
int16_t mouse_wr;
|
||||||
bool mouse_grabbed;
|
|
||||||
} cocoa_input_data_t;
|
} cocoa_input_data_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -40,40 +40,14 @@ static CMMotionManager *motionManager;
|
|||||||
#import <GameController/GameController.h>
|
#import <GameController/GameController.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
#define HIDKEY(X) X
|
|
||||||
#else
|
|
||||||
#define HIDKEY(X) (X < 128) ? MAC_NATIVE_TO_HID[X] : 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_ICADE_PROFILES 4
|
|
||||||
#define MAX_ICADE_KEYS 0x100
|
|
||||||
|
|
||||||
typedef struct icade_map
|
|
||||||
{
|
|
||||||
bool up;
|
|
||||||
enum retro_key key;
|
|
||||||
} icade_map_t;
|
|
||||||
|
|
||||||
/* TODO/FIXME -
|
/* TODO/FIXME -
|
||||||
* fix game focus toggle */
|
* fix game focus toggle */
|
||||||
|
|
||||||
/*
|
|
||||||
* FORWARD DECLARATIONS
|
|
||||||
*/
|
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
|
/* Forward declaration */
|
||||||
float cocoa_screen_get_backing_scale_factor(void);
|
float cocoa_screen_get_backing_scale_factor(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
/* TODO/FIXME - static globals */
|
|
||||||
static bool small_keyboard_active = false;
|
|
||||||
static icade_map_t icade_maps[MAX_ICADE_PROFILES][MAX_ICADE_KEYS];
|
|
||||||
#if TARGET_OS_IOS
|
|
||||||
static UISelectionFeedbackGenerator *feedbackGenerator;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool apple_key_state[MAX_KEYS];
|
static bool apple_key_state[MAX_KEYS];
|
||||||
|
|
||||||
/* Send keyboard inputs directly using RETROK_* codes
|
/* Send keyboard inputs directly using RETROK_* codes
|
||||||
@ -88,8 +62,27 @@ void apple_direct_input_keyboard_event(bool down,
|
|||||||
character, (enum retro_mod)mod, device);
|
character, (enum retro_mod)mod, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
static bool apple_input_handle_small_keyboard(unsigned* code, bool down)
|
/* TODO/FIXME - static globals */
|
||||||
|
static bool small_keyboard_active = false;
|
||||||
|
#if TARGET_OS_IOS
|
||||||
|
static UISelectionFeedbackGenerator *feedbackGenerator;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define HIDKEY(X) X
|
||||||
|
#define MAX_ICADE_PROFILES 4
|
||||||
|
#define MAX_ICADE_KEYS 0x100
|
||||||
|
|
||||||
|
typedef struct icade_map
|
||||||
|
{
|
||||||
|
bool up;
|
||||||
|
enum retro_key key;
|
||||||
|
} icade_map_t;
|
||||||
|
|
||||||
|
static icade_map_t icade_maps[MAX_ICADE_PROFILES][MAX_ICADE_KEYS];
|
||||||
|
|
||||||
|
static bool handle_small_keyboard(unsigned* code, bool down)
|
||||||
{
|
{
|
||||||
static uint8_t mapping[128];
|
static uint8_t mapping[128];
|
||||||
static bool map_initialized;
|
static bool map_initialized;
|
||||||
@ -144,10 +137,12 @@ static bool apple_input_handle_small_keyboard(unsigned* code, bool down)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool apple_input_handle_icade_event(unsigned kb_type_idx, unsigned *code, bool *keydown)
|
static bool handle_icade_event(unsigned *code, bool *keydown)
|
||||||
{
|
{
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
unsigned kb_type_idx = settings->uints.input_keyboard_gamepad_mapping_type;
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
@ -299,19 +294,18 @@ void apple_input_keyboard_event(bool down,
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool keyboard_gamepad_enable = settings->bools.input_keyboard_gamepad_enable;
|
bool keyboard_gamepad_enable = settings->bools.input_keyboard_gamepad_enable;
|
||||||
bool small_keyboard_enable = settings->bools.input_small_keyboard_enable;
|
bool small_keyboard_enable = settings->bools.input_small_keyboard_enable;
|
||||||
|
code = HIDKEY(code);
|
||||||
|
|
||||||
if (keyboard_gamepad_enable)
|
if (keyboard_gamepad_enable)
|
||||||
{
|
{
|
||||||
if (apple_input_handle_icade_event(
|
if (handle_icade_event(&code, &down))
|
||||||
settings->uints.input_keyboard_gamepad_mapping_type,
|
|
||||||
&code, &down))
|
|
||||||
character = 0;
|
character = 0;
|
||||||
else
|
else
|
||||||
code = 0;
|
code = 0;
|
||||||
}
|
}
|
||||||
else if (small_keyboard_enable)
|
else if (small_keyboard_enable)
|
||||||
{
|
{
|
||||||
if (apple_input_handle_small_keyboard(&code, down))
|
if (handle_small_keyboard(&code, down))
|
||||||
character = 0;
|
character = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,21 +319,24 @@ void apple_input_keyboard_event(bool down,
|
|||||||
character, (enum retro_mod)mod, device);
|
character, (enum retro_mod)mod, device);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
/* Taken from https://github.com/depp/keycode,
|
||||||
|
* check keycode.h for license. */
|
||||||
|
static const unsigned char MAC_NATIVE_TO_HID[128] = {
|
||||||
|
4, 22, 7, 9, 11, 10, 29, 27, 6, 25,255, 5, 20, 26, 8, 21,
|
||||||
|
28, 23, 30, 31, 32, 33, 35, 34, 46, 38, 36, 45, 37, 39, 48, 18,
|
||||||
|
24, 47, 12, 19, 40, 15, 13, 52, 14, 51, 49, 54, 56, 17, 16, 55,
|
||||||
|
43, 44, 53, 42,255, 41,231,227,225, 57,226,224,229,230,228,255,
|
||||||
|
108, 99,255, 85,255, 87,255, 83,255,255,255, 84, 88,255, 86,109,
|
||||||
|
110,103, 98, 89, 90, 91, 92, 93, 94, 95,111, 96, 97,255,255,255,
|
||||||
|
62, 63, 64, 60, 65, 66,255, 68,255,104,107,105,255, 67,255, 69,
|
||||||
|
255,106,117, 74, 75, 76, 61, 77, 59, 78, 58, 80, 79, 81, 82,255
|
||||||
|
};
|
||||||
|
|
||||||
|
#define HIDKEY(X) (X < 128) ? MAC_NATIVE_TO_HID[X] : 0
|
||||||
|
|
||||||
void apple_input_keyboard_event(bool down,
|
void apple_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)
|
||||||
{
|
{
|
||||||
/* Taken from https://github.com/depp/keycode,
|
|
||||||
* check keycode.h for license. */
|
|
||||||
static const unsigned char MAC_NATIVE_TO_HID[128] = {
|
|
||||||
4, 22, 7, 9, 11, 10, 29, 27, 6, 25,255, 5, 20, 26, 8, 21,
|
|
||||||
28, 23, 30, 31, 32, 33, 35, 34, 46, 38, 36, 45, 37, 39, 48, 18,
|
|
||||||
24, 47, 12, 19, 40, 15, 13, 52, 14, 51, 49, 54, 56, 17, 16, 55,
|
|
||||||
43, 44, 53, 42,255, 41,231,227,225, 57,226,224,229,230,228,255,
|
|
||||||
108, 99,255, 85,255, 87,255, 83,255,255,255, 84, 88,255, 86,109,
|
|
||||||
110,103, 98, 89, 90, 91, 92, 93, 94, 95,111, 96, 97,255,255,255,
|
|
||||||
62, 63, 64, 60, 65, 66,255, 68,255,104,107,105,255, 67,255, 69,
|
|
||||||
255,106,117, 74, 75, 76, 61, 77, 59, 78, 58, 80, 79, 81, 82,255
|
|
||||||
};
|
|
||||||
code = HIDKEY(code);
|
code = HIDKEY(code);
|
||||||
if (code == 0 || code >= MAX_KEYS)
|
if (code == 0 || code >= MAX_KEYS)
|
||||||
return;
|
return;
|
||||||
@ -354,7 +351,6 @@ void apple_input_keyboard_event(bool down,
|
|||||||
|
|
||||||
static void *cocoa_input_init(const char *joypad_driver)
|
static void *cocoa_input_init(const char *joypad_driver)
|
||||||
{
|
{
|
||||||
cocoa_input_data_t *apple = NULL;
|
|
||||||
#ifdef HAVE_COREMOTION
|
#ifdef HAVE_COREMOTION
|
||||||
if (@available(macOS 10.15, *))
|
if (@available(macOS 10.15, *))
|
||||||
if (!motionManager)
|
if (!motionManager)
|
||||||
@ -367,9 +363,8 @@ static void *cocoa_input_init(const char *joypad_driver)
|
|||||||
[feedbackGenerator prepare];
|
[feedbackGenerator prepare];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO/FIXME - shouldn't we free the above in case this fails for
|
cocoa_input_data_t *apple = (cocoa_input_data_t*)calloc(1, sizeof(*apple));
|
||||||
* TARGET_OS_IOS / HAVE_COREMOTION? */
|
if (!apple)
|
||||||
if (!(apple = (cocoa_input_data_t*)calloc(1, sizeof(*apple))))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
input_keymaps_init_keyboard_lut(rarch_key_map_apple_hid);
|
input_keymaps_init_keyboard_lut(rarch_key_map_apple_hid);
|
||||||
@ -442,8 +437,7 @@ static int16_t cocoa_input_state(
|
|||||||
{
|
{
|
||||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||||
{
|
{
|
||||||
if ((binds[port][i].key < RETROK_LAST)
|
if ((binds[port][i].key < RETROK_LAST) && apple_key_state[rarch_keysym_lut[binds[port][i].key]])
|
||||||
&& apple_key_state[rarch_keysym_lut[binds[port][i].key]])
|
|
||||||
ret |= (1 << i);
|
ret |= (1 << i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -576,16 +570,25 @@ static int16_t cocoa_input_state(
|
|||||||
|
|
||||||
if (touch)
|
if (touch)
|
||||||
{
|
{
|
||||||
|
int16_t x, y;
|
||||||
|
const bool want_full = (device == RARCH_DEVICE_POINTER_SCREEN);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case RETRO_DEVICE_ID_POINTER_PRESSED:
|
case RETRO_DEVICE_ID_POINTER_PRESSED:
|
||||||
if (device == RARCH_DEVICE_POINTER_SCREEN)
|
x = touch->fixed_x;
|
||||||
return (touch->full_x != -0x8000) && (touch->full_y != -0x8000); /* Inside? */
|
y = touch->fixed_y;
|
||||||
return (touch->fixed_x != -0x8000) && (touch->fixed_y != -0x8000); /* Inside? */
|
|
||||||
|
if (want_full)
|
||||||
|
{
|
||||||
|
x = touch->full_x;
|
||||||
|
y = touch->full_y;
|
||||||
|
}
|
||||||
|
return (x != -0x8000) && (y != -0x8000); /* Inside? */
|
||||||
case RETRO_DEVICE_ID_POINTER_X:
|
case RETRO_DEVICE_ID_POINTER_X:
|
||||||
return (device == RARCH_DEVICE_POINTER_SCREEN) ? touch->full_x : touch->fixed_x;
|
return want_full ? touch->full_x : touch->fixed_x;
|
||||||
case RETRO_DEVICE_ID_POINTER_Y:
|
case RETRO_DEVICE_ID_POINTER_Y:
|
||||||
return (device == RARCH_DEVICE_POINTER_SCREEN) ? touch->full_y : touch->fixed_y;
|
return want_full ? touch->full_y : touch->fixed_y;
|
||||||
case RETRO_DEVICE_ID_POINTER_COUNT:
|
case RETRO_DEVICE_ID_POINTER_COUNT:
|
||||||
return apple->touch_count;
|
return apple->touch_count;
|
||||||
}
|
}
|
||||||
@ -623,17 +626,16 @@ static uint64_t cocoa_input_get_capabilities(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool cocoa_input_set_sensor_state(void *data, unsigned port,
|
static bool cocoa_input_set_sensor_state(void *data, unsigned port,
|
||||||
enum retro_sensor_action action, unsigned rate)
|
enum retro_sensor_action action, unsigned rate)
|
||||||
{
|
{
|
||||||
if ( (action != RETRO_SENSOR_ACCELEROMETER_ENABLE)
|
if (action != RETRO_SENSOR_ACCELEROMETER_ENABLE &&
|
||||||
&& (action != RETRO_SENSOR_ACCELEROMETER_DISABLE)
|
action != RETRO_SENSOR_ACCELEROMETER_DISABLE &&
|
||||||
&& (action != RETRO_SENSOR_GYROSCOPE_ENABLE)
|
action != RETRO_SENSOR_GYROSCOPE_ENABLE &&
|
||||||
&& (action != RETRO_SENSOR_GYROSCOPE_DISABLE))
|
action != RETRO_SENSOR_GYROSCOPE_DISABLE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef HAVE_MFI
|
#ifdef HAVE_MFI
|
||||||
if (@available(iOS 14.0, macOS 11.0, *))
|
if (@available(iOS 14.0, macOS 11.0, *)) {
|
||||||
{
|
|
||||||
for (GCController *controller in [GCController controllers])
|
for (GCController *controller in [GCController controllers])
|
||||||
{
|
{
|
||||||
if (!controller || controller.playerIndex != port)
|
if (!controller || controller.playerIndex != port)
|
||||||
@ -642,15 +644,13 @@ static bool cocoa_input_set_sensor_state(void *data, unsigned port,
|
|||||||
break;
|
break;
|
||||||
if (controller.motion.sensorsRequireManualActivation)
|
if (controller.motion.sensorsRequireManualActivation)
|
||||||
{
|
{
|
||||||
/* This is a bug, we assume if you turn on/off either
|
// this is a bug, we assume if you turn on/off either you want both on/off
|
||||||
* you want both on/off */
|
if (action == RETRO_SENSOR_ACCELEROMETER_ENABLE || action == RETRO_SENSOR_GYROSCOPE_ENABLE)
|
||||||
if ( (action == RETRO_SENSOR_ACCELEROMETER_ENABLE)
|
|
||||||
|| (action == RETRO_SENSOR_GYROSCOPE_ENABLE))
|
|
||||||
controller.motion.sensorsActive = YES;
|
controller.motion.sensorsActive = YES;
|
||||||
else
|
else
|
||||||
controller.motion.sensorsActive = NO;
|
controller.motion.sensorsActive = NO;
|
||||||
}
|
}
|
||||||
/* no such thing as update interval for GCController? */
|
// no such thing as update interval for GCController?
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -663,8 +663,7 @@ static bool cocoa_input_set_sensor_state(void *data, unsigned port,
|
|||||||
if (!motionManager || !motionManager.deviceMotionAvailable)
|
if (!motionManager || !motionManager.deviceMotionAvailable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( (action == RETRO_SENSOR_ACCELEROMETER_ENABLE)
|
if (action == RETRO_SENSOR_ACCELEROMETER_ENABLE || action == RETRO_SENSOR_GYROSCOPE_ENABLE)
|
||||||
|| (action == RETRO_SENSOR_GYROSCOPE_ENABLE))
|
|
||||||
{
|
{
|
||||||
if (!motionManager.deviceMotionActive)
|
if (!motionManager.deviceMotionActive)
|
||||||
[motionManager startDeviceMotionUpdates];
|
[motionManager startDeviceMotionUpdates];
|
||||||
@ -685,8 +684,7 @@ static bool cocoa_input_set_sensor_state(void *data, unsigned port,
|
|||||||
static float cocoa_input_get_sensor_input(void *data, unsigned port, unsigned id)
|
static float cocoa_input_get_sensor_input(void *data, unsigned port, unsigned id)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MFI
|
#ifdef HAVE_MFI
|
||||||
if (@available(iOS 14.0, *))
|
if (@available(iOS 14.0, *)) {
|
||||||
{
|
|
||||||
for (GCController *controller in [GCController controllers])
|
for (GCController *controller in [GCController controllers])
|
||||||
{
|
{
|
||||||
if (!controller || controller.playerIndex != port)
|
if (!controller || controller.playerIndex != port)
|
||||||
@ -713,23 +711,26 @@ static float cocoa_input_get_sensor_input(void *data, unsigned port, unsigned id
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COREMOTION
|
#ifdef HAVE_COREMOTION
|
||||||
if (port == 0 && motionManager && motionManager.deviceMotionActive)
|
if (port != 0)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
|
if (!motionManager || !motionManager.deviceMotionActive)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
|
switch (id)
|
||||||
{
|
{
|
||||||
switch (id)
|
case RETRO_SENSOR_ACCELEROMETER_X:
|
||||||
{
|
return motionManager.deviceMotion.userAcceleration.x;
|
||||||
case RETRO_SENSOR_ACCELEROMETER_X:
|
case RETRO_SENSOR_ACCELEROMETER_Y:
|
||||||
return motionManager.deviceMotion.userAcceleration.x;
|
return motionManager.deviceMotion.userAcceleration.y;
|
||||||
case RETRO_SENSOR_ACCELEROMETER_Y:
|
case RETRO_SENSOR_ACCELEROMETER_Z:
|
||||||
return motionManager.deviceMotion.userAcceleration.y;
|
return motionManager.deviceMotion.userAcceleration.z;
|
||||||
case RETRO_SENSOR_ACCELEROMETER_Z:
|
case RETRO_SENSOR_GYROSCOPE_X:
|
||||||
return motionManager.deviceMotion.userAcceleration.z;
|
return motionManager.deviceMotion.rotationRate.x;
|
||||||
case RETRO_SENSOR_GYROSCOPE_X:
|
case RETRO_SENSOR_GYROSCOPE_Y:
|
||||||
return motionManager.deviceMotion.rotationRate.x;
|
return motionManager.deviceMotion.rotationRate.y;
|
||||||
case RETRO_SENSOR_GYROSCOPE_Y:
|
case RETRO_SENSOR_GYROSCOPE_Z:
|
||||||
return motionManager.deviceMotion.rotationRate.y;
|
return motionManager.deviceMotion.rotationRate.z;
|
||||||
case RETRO_SENSOR_GYROSCOPE_Z:
|
|
||||||
return motionManager.deviceMotion.rotationRate.z;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -737,33 +738,13 @@ static float cocoa_input_get_sensor_input(void *data, unsigned port, unsigned id
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if TARGET_OS_IOS
|
#if TARGET_OS_IOS
|
||||||
static void cocoa_input_keypress_vibrate(void)
|
static void cocoa_input_keypress_vibrate()
|
||||||
{
|
{
|
||||||
[feedbackGenerator selectionChanged];
|
[feedbackGenerator selectionChanged];
|
||||||
[feedbackGenerator prepare];
|
[feedbackGenerator prepare];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
|
||||||
static void cocoa_input_grab_mouse(void *data, bool state)
|
|
||||||
{
|
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
|
||||||
|
|
||||||
if (state)
|
|
||||||
{
|
|
||||||
NSWindow *window = (BRIDGE NSWindow*)ui_companion_cocoa.get_main_window(nil);
|
|
||||||
CGPoint window_pos = window.frame.origin;
|
|
||||||
CGSize window_size = window.frame.size;
|
|
||||||
CGPoint window_center = CGPointMake(window_pos.x + window_size.width / 2.0f, window_pos.y + window_size.height / 2.0f);
|
|
||||||
CGWarpMouseCursorPosition(window_center);
|
|
||||||
}
|
|
||||||
|
|
||||||
CGAssociateMouseAndMouseCursorPosition(!state);
|
|
||||||
cocoa_show_mouse(nil, !state);
|
|
||||||
apple->mouse_grabbed = state;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
input_driver_t input_cocoa = {
|
input_driver_t input_cocoa = {
|
||||||
cocoa_input_init,
|
cocoa_input_init,
|
||||||
cocoa_input_poll,
|
cocoa_input_poll,
|
||||||
@ -773,15 +754,11 @@ input_driver_t input_cocoa = {
|
|||||||
cocoa_input_get_sensor_input,
|
cocoa_input_get_sensor_input,
|
||||||
cocoa_input_get_capabilities,
|
cocoa_input_get_capabilities,
|
||||||
"cocoa",
|
"cocoa",
|
||||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
|
||||||
cocoa_input_grab_mouse,
|
|
||||||
#else
|
|
||||||
NULL, /* grab_mouse */
|
NULL, /* grab_mouse */
|
||||||
#endif
|
|
||||||
NULL, /* grab_stdin */
|
NULL, /* grab_stdin */
|
||||||
#if TARGET_OS_IOS
|
#if TARGET_OS_IOS
|
||||||
cocoa_input_keypress_vibrate
|
cocoa_input_keypress_vibrate
|
||||||
#else
|
#else
|
||||||
NULL /* vibrate */
|
NULL
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -454,6 +454,7 @@
|
|||||||
05C5D53320E3DD0900654EE4 /* input_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input_types.h; sourceTree = "<group>"; };
|
05C5D53320E3DD0900654EE4 /* input_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input_types.h; sourceTree = "<group>"; };
|
||||||
05C5D53820E3DD0900654EE4 /* cocoa_input.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cocoa_input.h; sourceTree = "<group>"; };
|
05C5D53820E3DD0900654EE4 /* cocoa_input.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cocoa_input.h; sourceTree = "<group>"; };
|
||||||
05C5D54120E3DD0900654EE4 /* sdl_input.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sdl_input.c; sourceTree = "<group>"; };
|
05C5D54120E3DD0900654EE4 /* sdl_input.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sdl_input.c; sourceTree = "<group>"; };
|
||||||
|
05C5D54220E3DD0900654EE4 /* cocoa_input.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cocoa_input.c; sourceTree = "<group>"; };
|
||||||
05C5D54C20E3DD0900654EE4 /* input_keymaps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input_keymaps.h; sourceTree = "<group>"; };
|
05C5D54C20E3DD0900654EE4 /* input_keymaps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input_keymaps.h; sourceTree = "<group>"; };
|
||||||
05C5D54E20E3DD0900654EE4 /* blissbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = blissbox.h; sourceTree = "<group>"; };
|
05C5D54E20E3DD0900654EE4 /* blissbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = blissbox.h; sourceTree = "<group>"; };
|
||||||
05C5D55420E3DD0900654EE4 /* GCExtendedGamepadSnapshot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GCExtendedGamepadSnapshot.h; sourceTree = "<group>"; };
|
05C5D55420E3DD0900654EE4 /* GCExtendedGamepadSnapshot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GCExtendedGamepadSnapshot.h; sourceTree = "<group>"; };
|
||||||
@ -553,7 +554,6 @@
|
|||||||
A9020FA64527ED74C836B41D /* cocoa_gl_ctx_metal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocoa_gl_ctx_metal.m; sourceTree = "<group>"; };
|
A9020FA64527ED74C836B41D /* cocoa_gl_ctx_metal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocoa_gl_ctx_metal.m; sourceTree = "<group>"; };
|
||||||
D27C50872228360000113BC0 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
D27C50872228360000113BC0 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||||
D27C50892228360D00113BC0 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
D27C50892228360D00113BC0 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||||
E8EE1E942A2C6A26003C73F6 /* cocoa_input.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cocoa_input.m; sourceTree = "<group>"; };
|
|
||||||
F0B1238F270D73A90006E60F /* connect */ = {isa = PBXFileReference; lastKnownFileType = folder; path = connect; sourceTree = "<group>"; };
|
F0B1238F270D73A90006E60F /* connect */ = {isa = PBXFileReference; lastKnownFileType = folder; path = connect; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
@ -838,6 +838,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
05A8C55E20DB72F000FF7857 /* menu_osk_utf8_pages.h */,
|
05A8C55E20DB72F000FF7857 /* menu_osk_utf8_pages.h */,
|
||||||
|
05A8C55F20DB72F000FF7857 /* menu_osk.h */,
|
||||||
);
|
);
|
||||||
path = widgets;
|
path = widgets;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -1239,7 +1240,7 @@
|
|||||||
05C5D53520E3DD0900654EE4 /* drivers */ = {
|
05C5D53520E3DD0900654EE4 /* drivers */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
E8EE1E942A2C6A26003C73F6 /* cocoa_input.m */,
|
05C5D54220E3DD0900654EE4 /* cocoa_input.c */,
|
||||||
05C5D53820E3DD0900654EE4 /* cocoa_input.h */,
|
05C5D53820E3DD0900654EE4 /* cocoa_input.h */,
|
||||||
05C5D54120E3DD0900654EE4 /* sdl_input.c */,
|
05C5D54120E3DD0900654EE4 /* sdl_input.c */,
|
||||||
);
|
);
|
||||||
|
@ -467,14 +467,8 @@ static ui_application_t ui_application_cocoa = {
|
|||||||
/* Absolute */
|
/* Absolute */
|
||||||
apple->touches[0].screen_x = (int16_t)pos.x;
|
apple->touches[0].screen_x = (int16_t)pos.x;
|
||||||
apple->touches[0].screen_y = (int16_t)pos.y;
|
apple->touches[0].screen_y = (int16_t)pos.y;
|
||||||
|
apple->window_pos_x = (int16_t)pos.x;
|
||||||
if (apple->mouse_grabbed) {
|
apple->window_pos_y = (int16_t)pos.y;
|
||||||
apple->window_pos_x += (int16_t)delta_x;
|
|
||||||
apple->window_pos_y += (int16_t)delta_y;
|
|
||||||
} else {
|
|
||||||
apple->window_pos_x = (int16_t)pos.x;
|
|
||||||
apple->window_pos_y = (int16_t)pos.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(HAVE_COCOA_METAL)
|
#if defined(HAVE_COCOA_METAL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user