diff --git a/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Debug.xcscheme b/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Debug.xcscheme
index d264a8aa1d..bac383c35e 100644
--- a/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Debug.xcscheme
+++ b/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Debug.xcscheme
@@ -15,7 +15,7 @@
@@ -31,7 +31,7 @@
@@ -54,7 +54,7 @@
@@ -71,7 +71,7 @@
diff --git a/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Release.xcscheme b/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Release.xcscheme
index 89b296670c..42aa74a6f3 100644
--- a/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Release.xcscheme
+++ b/pkg/apple/RetroArch_iOS13.xcodeproj/xcshareddata/xcschemes/RetroArch tvOS Release.xcscheme
@@ -15,7 +15,7 @@
@@ -31,7 +31,7 @@
@@ -54,7 +54,7 @@
@@ -71,7 +71,7 @@
diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m
index 722384ebf0..b6781f2a33 100644
--- a/ui/drivers/ui_cocoatouch.m
+++ b/ui/drivers/ui_cocoatouch.m
@@ -120,13 +120,13 @@ static uintptr_t ui_companion_cocoatouch_get_app_icon_texture(const char *icon)
if (!img)
{
RARCH_LOG("could not load %s\n", icon);
- return NULL;
+ return 0;
}
NSData *png = UIImagePNGRepresentation(img);
if (!png)
{
RARCH_LOG("could not get png for %s\n", icon);
- return NULL;
+ return 0;
}
uintptr_t item;
@@ -374,6 +374,60 @@ enum
return [super _keyCommandForEvent:event];
}
+#else
+- (void)handleUIPress:(UIPress *)press withEvent:(UIPressesEvent *)event down:(BOOL)down
+{
+ NSString *ch = (NSString*)press.key.characters;
+ uint32_t character = 0;
+ uint32_t mod = 0;
+ NSUInteger mods = event.modifierFlags;
+
+ if (mods & UIKeyModifierAlphaShift)
+ mod |= RETROKMOD_CAPSLOCK;
+ if (mods & UIKeyModifierShift)
+ mod |= RETROKMOD_SHIFT;
+ if (mods & UIKeyModifierControl)
+ mod |= RETROKMOD_CTRL;
+ if (mods & UIKeyModifierAlternate)
+ mod |= RETROKMOD_ALT;
+ if (mods & UIKeyModifierCommand)
+ mod |= RETROKMOD_META;
+ if (mods & UIKeyModifierNumericPad)
+ mod |= RETROKMOD_NUMLOCK;
+
+ if (ch && ch.length != 0)
+ {
+ unsigned i;
+ character = [ch characterAtIndex:0];
+
+ apple_input_keyboard_event(down,
+ (uint32_t)press.key.keyCode, 0, mod,
+ RETRO_DEVICE_KEYBOARD);
+
+ for (i = 1; i < ch.length; i++)
+ apple_input_keyboard_event(down,
+ 0, [ch characterAtIndex:i], mod,
+ RETRO_DEVICE_KEYBOARD);
+ }
+
+ apple_input_keyboard_event(down,
+ (uint32_t)press.key.keyCode, character, mod,
+ RETRO_DEVICE_KEYBOARD);
+}
+
+- (void)pressesBegan:(NSSet *)presses withEvent:(UIPressesEvent *)event
+{
+ for (UIPress *press in presses)
+ [self handleUIPress:press withEvent:event down:YES];
+ [super pressesBegan:presses withEvent:event];
+}
+
+- (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)event
+{
+ for (UIPress *press in presses)
+ [self handleUIPress:press withEvent:event down:NO];
+ [super pressesEnded:presses withEvent:event];
+}
#endif
#define GSEVENT_TYPE_KEYDOWN 10