mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 08:59:58 +00:00
(iOS) Add iCade toggle option to prevent OSK from popping up
This commit is contained in:
parent
55a274a5a0
commit
7319260957
@ -226,6 +226,12 @@ static bool g_is_syncing = true;
|
||||
];
|
||||
}
|
||||
|
||||
- (void)iOS7SetiCadeMode:(bool)on
|
||||
{
|
||||
g_text_hide.enabled = on;
|
||||
[self viewWillLayoutSubviews];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
@ -2,12 +2,25 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>File</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.pkware.zip-archive</string>
|
||||
</array>
|
||||
<key>abc</key>
|
||||
<string>xyz</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@ -50,5 +63,7 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -23,6 +23,7 @@
|
||||
+ (RAGameView*)get;
|
||||
- (void)openPauseMenu;
|
||||
- (void)closePauseMenu;
|
||||
- (void)iOS7SetiCadeMode:(bool)on;
|
||||
@end
|
||||
|
||||
@interface RetroArch_iOS : UINavigationController<UIApplicationDelegate, UINavigationControllerDelegate, RetroArch_Platform,
|
||||
|
@ -35,7 +35,9 @@ void ios_set_bluetooth_mode(NSString* mode)
|
||||
apple_input_enable_icade([mode isEqualToString:@"icade"]);
|
||||
btstack_set_poweron([mode isEqualToString:@"btstack"]);
|
||||
#else
|
||||
apple_input_enable_icade(true);
|
||||
bool enabled = [mode isEqualToString:@"icade"];
|
||||
apple_input_enable_icade(enabled);
|
||||
[[RAGameView get] iOS7SetiCadeMode:enabled];
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -77,7 +79,7 @@ static void handle_touch_event(NSArray* touches)
|
||||
if ([[event allTouches] count])
|
||||
handle_touch_event(event.allTouches.allObjects);
|
||||
else if ([event respondsToSelector:@selector(_gsEvent)])
|
||||
{
|
||||
{
|
||||
// Stolen from: http://nacho4d-nacho4d.blogspot.com/2012/01/catching-keyboard-events-in-ios.html
|
||||
uint8_t* eventMem = (uint8_t*)(void*)CFBridgingRetain([event performSelector:@selector(_gsEvent)]);
|
||||
int eventType = eventMem ? *(int*)&eventMem[8] : 0;
|
||||
@ -177,6 +179,19 @@ static void handle_touch_event(NSArray* touches)
|
||||
}
|
||||
|
||||
#pragma mark Frontend Browsing Logic
|
||||
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
|
||||
{
|
||||
NSString* filename = url.path.lastPathComponent;
|
||||
|
||||
NSError* error = nil;
|
||||
[NSFileManager.defaultManager moveItemAtPath:url.path toPath:[self.documentsDirectory stringByAppendingPathComponent:filename] error:&error];
|
||||
|
||||
if (error)
|
||||
printf("%s\n", error.description.UTF8String);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
- (void)beginBrowsingForFile
|
||||
{
|
||||
NSString* rootPath = RetroArch_iOS.get.documentsDirectory;
|
||||
|
@ -416,23 +416,23 @@ static void bluetooth_option_changed(RASettingData* setting)
|
||||
}
|
||||
|
||||
|
||||
#ifndef __IPHONE_7_0 // iOS7 iCade Support
|
||||
NSArray* bluetoothOptions = [NSArray arrayWithObjects:@"keyboard", @"Keyboard",
|
||||
@"icade", @"iCade Device",
|
||||
btstack_try_load() ? @"btstack" : nil, @"WiiMote/SixAxis (BTstack)",
|
||||
nil];
|
||||
#endif
|
||||
NSArray* bluetoothOptions = nil;
|
||||
|
||||
if (!is_ios_7() && btstack_try_load())
|
||||
bluetoothOptions = @[@"keyboard", @"Keyboard", @"icade", @"iCade Device", @"btstack", @"WiiMote/SixAxis (BTstack)"];
|
||||
else if (!is_ios_7())
|
||||
bluetoothOptions = @[@"keyboard", @"Keyboard", @"icade", @"iCade Device"];
|
||||
else // if (is_ios_7())
|
||||
bluetoothOptions = @[@"none", @"None", @"icade", @"iCade Device"];
|
||||
|
||||
NSArray* settings = [NSArray arrayWithObjects:
|
||||
[NSArray arrayWithObjects:@"Frontend",
|
||||
custom_action(@"Diagnostic Log", nil, nil, 0),
|
||||
boolean_setting(config, @"ios_tv_mode", @"TV Mode", @"false"),
|
||||
nil],
|
||||
#ifndef __IPHONE_7_0 // iOS7 iCade Support
|
||||
[NSArray arrayWithObjects:@"Bluetooth",
|
||||
change_notify(enumeration_setting(config, @"ios_btmode", @"Mode", @"keyboard", bluetoothOptions, true), bluetooth_option_changed),
|
||||
nil],
|
||||
#endif
|
||||
[NSArray arrayWithObjects:@"Orientations",
|
||||
boolean_setting(config, @"ios_allow_portrait", @"Portrait", @"true"),
|
||||
boolean_setting(config, @"ios_allow_portrait_upside_down", @"Portrait Upside Down", @"true"),
|
||||
|
Loading…
Reference in New Issue
Block a user