Bluetooth keyboard and iCade controllers not working (build date Nov 8, 2015)

[QUOTE=Twinaphex;30962]I don’t think any of my devices are non-jailbroken. I also don’t think Controllers For All has any impact on this at all. I have it disabled when I connect it with the iPega pad.

All I can tell you is that this iPega pad works for me and it’s the only iCade compatible pad I can test. I tested it on an iPad Mini 2 (jailbroken) and an iPhone 5 (jailbroken). Both are on iOS 8.4. 'll test it later on an iPhone 4s which is also jailbroken. If it works on those all then I don’t know what your problem is. Maybe you haven’t set the pad to iCade mode properly?

Anyway, I have to say, I’d rather you guys were on IRC instead of here because you cannot really debug things like this in non-realtime. It is just very backwards to have to wait for posts on here and then make a response to it. I’d also like more devs with rudimentary C/ObjC skills to take a look into the codebase since I don’t know everything about iOS development obviously and I can only test on jailbroken devices.

EDIT: Works on the iPhone 4S too.[/QUOTE] Hi twinaphex, have you started working on PS3/PS4 controller, I think these the most widely used controllers available out there, it would be awesome if you can get the analogs working again, the weird thing is it’s working in the white menu, but not in the UI mode, or in game , I wish if you could focus on that, thank you for the amazing emulator.

UI mode is going away. The guy who wrote it takes forever to fix the bugs left in it and I fear he simply is never going to do it. Only the current MaterialUI and other GL-based menus will remain. They will obviously be improved functionality wise but I don’t think we should waste any more time on UI (Cocoa) mode.

Well, I could never get it working on my non-jailbroken devices. I did dig out an old iOS device that was on 8.4 and I jailbroke it and I was able to get both my icade controller and my bluetooth keyboard to work with retroarch but only after installing btstack from cydia, and i was even able to get a ps3 controller working using controllers for all. i suppose that btstack from cydia has something to do with it since i can’t install that on a non-jailbroken device and you have been able to get your stuff working on jailbroken devices. i guess that explains why i can use my controller and bluetooth keyboard in literally every app on a non-jailbroken device except retroarch and that i can enter input from my controller and external bluetooth in every app except retroarch.

if i ever get this working i will update this thread. i’m glad i was able to help a little bit by helping with the snes30 controller. i hope that helps others.

one last update. i borrowed the same version of the Pegi controller you have from a coworker (lucky) and it doesn’t work as well so i still think this is because you have jailbroken devices. as soon as retroarch is launched the bluetooth controller seems to lose connection to the phone or something. and as soon as retroarch quits the controller regains a connection or at least works again.

there is just no way to get bluetooth to work with retroarch unless you are jailbroken for some reason and whatever that reason is. in case anyone is not jailbroken and cant get bluetooth to work this is why.

I solved it. Finally.

search the iOS Xcode project for “btstack” and you’ll get 4 results. the first two relate to the custom compiler flags for Apple LLVM 7.0 in the retroarch project. If you delete the reefernce to -DHAVE_BTSTACK for both debug and release, bluetooth will work for non-jailbroken devices. Everything works, except I can’t get PSX games to recognize the analog sticks, but i can bind them for whatever reason. Other than that, all controller buttons work. So, in a way, i was right that it is btstack’s fault and it is looking for jailbroken devices having btstack installed.

Yippie!

I’m still having issues getting my iCade controller working. I have an NES30 8bitdo on an iPad Air running jailbroken iOS 9.0.2. I am using the latest Cydia nightly 11/30/2015. My controller is recognized by the OS but no button presses appear to register. Keyboard game pad mapping is enable.

[QUOTE=i415206;31089]I solved it. Finally. Everything works, except I can’t get PSX games to recognize the analog sticks, but i can bind them for whatever reason.
Yippie![/QUOTE] Most PSX games only had digital controls, the dual shock with analog launched late into the life of the original Playstation so that’s probably why you can’t get games to recognise them.

Still struggling to get retroarch to recognize my NES30. It has the same key mapping as the SNES30. I tried installing CFA but didn’t have any luck. I have tried the Bluetooth keyboard mode and the iCade mode. I’m able to use Provenance emulator with the controller without any issues (but I’d prefer retroarch).

I too am still unable to get retroarch to respond to my controller for mapping (Steel Series) Others have had success so perhaps I am not doing something correctly. My IOS appears to recognize and respond to the controller but I cant get retroarch to see it…it once did work so I am not giving up hope!

It definitely works in the latest build as I’ve been using mine every day since the update went live :slight_smile:

Are you sure you’re using the latest build from the Cydia Repo? The build I’m using is labeled as 1.2.2 and dated as 29/11/2015 09.43.41 (although that date and time part may relate to when I installed it rather than when it was uploaded and went live?

It’s one of the nightly builds anyway on their Repo and the Steel Series Stratus definitely works, although it was a little fiddly to configure.

Definitely don’t give up :slight_smile:

I’m having the exact same issue - NES30 controller can successfully connect to the iPhone but RetroArch doesn’t respond to key presses.

Specs: iPhone 6 (iOS 9.0.2, Pangu jailbreak 1.2) RetroArch (1.2.2.2015.12.05.05.45.40) 8BitDo NES30 gamepad (Firmware 2.63)

RetroArch config: Small keyboard enable - Off Keyboard gamepad mapping enable - On Keyboard gamepad mapping type - SNES30 8bitdo

I’ve tried:

  • Connecting the NES30 under both iCade and keyboard modes
  • Switching between the iPega, 8Bitty, and SNES30 mapping types on RetroArch
  • Toggling keyboard gamepad enable on and off
  • Running with and without BTStack installed

Attempting to bind keys will cause the window to popup but nothing happens when pressing anything on the NES30, and the window just times out. Having BTStack either installed or not makes no difference. Meanwhile, the NES30 works fine in other apps under both iCade mode (tested on Activision Anthology) and keyboard mode (tested on Notes). It seems the issue is specific to RetroArch and not iOS itself.

ControllersForAll works with a Dual Shock 3 controller, but it’s not ideal as it requires a separate tweak and the Start and Select buttons can’t be mapped.

Confirm that icade mode controller mapping is NOT working. I’m using phonejoy in icade mode, it works perfect with ppsspp and Snes9x EX, but retroarch does not recognize controller key pressing in mapping mode. Only way play retroarch with physical controller is mfi/controllers for all (which is not supported my phonejoy, sadly)

[QUOTE=i415206;31089]I solved it. Finally.

search the iOS Xcode project for “btstack” and you’ll get 4 results. the first two relate to the custom compiler flags for Apple LLVM 7.0 in the retroarch project. If you delete the reefernce to -DHAVE_BTSTACK for both debug and release, bluetooth will work for non-jailbroken devices. Everything works, except I can’t get PSX games to recognize the analog sticks, but i can bind them for whatever reason. Other than that, all controller buttons work. So, in a way, i was right that it is btstack’s fault and it is looking for jailbroken devices having btstack installed.

Yippie![/QUOTE]

I tried to do the same and removed the BTstack references in the compiler flags but it did nothing. My Impulse controller is still not working. I know it’s connected correctly because I can use it as an iCade pad for other apps. I tried with both the 8-bitty and iPega profiles. Any ideas about something I could have missed?

[Edit] I also tried with an 8-Bitty since it was in the preconfigured profiles and still no response when I try to map the buttons.

[Edit2] My iPhone is not jailbroken and I built RetroArch from today’s Github. Maybe the source changed since you posted your solution.

Just a quick update, I tried using a standard Bluetooth keyboard and RetroArch doesn’t respond to the keys at all, exactly like with iCade. Since iCade controllers essentially function as re-mapped keyboards, it looks like the code for keyboard support is broken somewhere.

is there something we can do to help the developers figure this bug out?

Hello all,

I dont want to be a bearer of even worse news, but this seems to go derper than retroarch. I had a couple of emulators installed on my non-jailbromen iphone, and since updating to 9.02 my ipega no longer works with any of them. In fact, when mapped as a keyboard, it’s not even overiding the software keyboard in messages.

[QUOTE=Fatnick;32533]Hello all,

I dont want to be a bearer of even worse news, but this seems to go derper than retroarch. I had a couple of emulators installed on my non-jailbromen iphone, and since updating to 9.02 my ipega no longer works with any of them. In fact, when mapped as a keyboard, it’s not even overiding the software keyboard in messages.[/QUOTE]

It looks like iOS 9 might have changed something about how non-MFi Bluetooth controllers work. NES30 still works in App Store games (but not RetroArch) under iCade mode and key presses register when under keyboard mode, but according to other users’ reports iPega doesn’t work at all. These inconsistencies may be caused by how different manufacturers program their controller mappings, and RetroArch seems to be affected on the side. :frowning:

Having just acquired a 8bitdo SFC30 controller, i wanted to get this to work with RetroArch on my nonjailbroken iPhone 6 Plus running iOS 9.2.

I looked into the Xcode project and after some poking around, I think the reason has to do with how the keyboard is being read. It looks like a private (?) method ([UIApplication _keyCommandForEvent] is being overridden in the UIApplication class and my guess is that iOS 9 doesn’t allow keyboard input to be read like that anymore.

If you’re starting out on the Xcode project here’s some useful tips:

/core/griffin/griffin.c is your entry point to understand things. All the source files are brought in via #include statements using C compiler flags that determine what gets included based on device, etc.

Cmd-click into the source files to look at them. Why they’re not part of the project, I dunno but i’m not gonna bother changing the project to do that. You can also cmd-shift-O to look into the source files by name too.

You can place breakpoints in the included files, but you might need to follow the instructions here:

…and I have a fix! :slight_smile:

Turns out iOS 9 has a different (private) method to read keyboard input, and i was able to just use the new method with the existing logic intact (copied!).

I made a pull request:

I also fixed the 8bitdo SNES30/SFC30 iCade mappings as one of them was off :slight_smile:

If @twinaphex approves the fix, you should see it in a nightly pretty soon!

@harakari2 PR looks good. I’m sure he’ll merge it soon. That’s exactly the sort of thing we need a dedicated OSX/iOS dev(s) to handle. Apple constantly changes things like that for little or no apparent reason, so it’s a real bear trying to keep up. :slight_smile: