MeSNEmu icon indicating copy to clipboard operation
MeSNEmu copied to clipboard

Add support for other iCade-like controllers (Submit your info here)

Open lmmenge opened this issue 11 years ago • 33 comments

Many iCade-like controllers (controllers that connect to iOS devices as if they were bluetooth keyboards) have different key maps for their buttons. Take for instance the iCade 8-Bitty: it's different enough from the original iCade that some games are nearly unplayable on this controller.

So in order to add support to various iCade-like controllers, I need your help: if you have an iCade-like controller that is not currently supported by MeSNEmu and you want it supported, please follow these instructions and support for it will be added ASAP:

  • Pair your bluetooth controller with an iOS device;
  • Make sure your device's keyboard layout is set to US (QWERTY);
  • Open Notes;
  • Enter the following button sequence matching, as best as you can, the SNES button layout: Up, Right, Down, Left, Select, Start, Y, B, X, A, L, R;
  • Copy the text generated (there should be 24 letters) and comment it here along with the controller make and model.

The button sequence you press is very important, since some controllers don't have the exact same layout as a SNES controller. Please try to match it as closely as possible for the best gameplay experience. Below is a picture of a SNES controller. The L and R buttons are on the shoulders of the controller: snes-controller

lmmenge avatar Aug 28 '13 17:08 lmmenge

The following text string is from a SteelSeries Free gamepad: wedcxzaqoglvythrufjnimkp

I verified it is correct by replacing a previous controller's setOnStateString and offStateString in LMBTControllerView.m with the appropriate on and off character from the above string and testing it out.

infernoten avatar Dec 01 '13 21:12 infernoten

Hello infernoten! Thanks for submitting. Just confirming the string that will be added to master (since you mentioned you did this before): [self LMBT_setOnStateString:"wdxaolyhujik" offStateString:"eczqgvtrfnmp"];

That looks like a really nice gamepad, too! Comfy?

lmmenge avatar Dec 03 '13 02:12 lmmenge

That matches what I inserted.

For a small controller, the Free is surprisingly comfy. The shoulder buttons have a really audible click to them, though.

infernoten avatar Dec 03 '13 04:12 infernoten

SteelSeries Free support pushed to master.

lmmenge avatar Dec 03 '13 13:12 lmmenge

The following text string is from a 8bitdo FC30 gamepad: wedcxzaqtufimkpoglvhrjnu

How I fix de buttons position?

eltonsalmeida avatar Jan 24 '14 16:01 eltonsalmeida

8Bitdo FC30 support pushed to master.

lmmenge avatar Jan 29 '14 14:01 lmmenge

The 8Bitdo FC30 strings currently in the code didn't work for me; I had to change it to the following:

[self LMBT_setOnStateString:"wdxazuikolhj"
             offStateString:"ecyqtfmpgvrn"];

guidoscheffler avatar Feb 25 '14 21:02 guidoscheffler

@eltonsalmeida @guidoscheffler what kind of keyboard layout and language are you guys using? Could this difference be due to keyboard layout mismatches?

lmmenge avatar Feb 25 '14 21:02 lmmenge

My system language is English; for keyboard layouts I usually switch between English and German. The keyboard layout seems to indeed be the problem; depending on what I set the layout to before connecting the 8Bitdo FC30, the strings are:

  • English: wedcxzaqytufimkpoglvhrjn
  • German: wedcxyaqztufimkpoglvhrjn

Either way, there definitely is an error in @eltonsalmeida's string, because it contains two "u"s. It seems that he turned off the controller by holding down start at the end, which resulted in the second u, and somehow didn't record push select correctly, which would explain the missing z/y at position 9 when comparing it to my strings.

guidoscheffler avatar Feb 26 '14 08:02 guidoscheffler

@guidoscheffler you are correct. I've just pushed to master your English 8Bitdo FC30 string. Thank you for correcting this.

lmmenge avatar Feb 26 '14 13:02 lmmenge

I've built a customer snes controller using the guide from adafruit. (https://learn.adafruit.com/snes-ez-key-bluefruit-game-pad/overview) The controller works great, and I can re-map the buttons to any keys I want. However, it doesn't send the off keys, only on. Any thoughts on how I can make SiOS work with that?

wiegerthefarmer avatar Oct 13 '14 02:10 wiegerthefarmer

@wiegerthefarmer You need the down/up events separately for the current architecture (both the iOS front-end and the SNES9X back-end use that paradigm). Otherwise, how do we know when you're still holding the button down? How do we know when you have released it?

lmmenge avatar Oct 13 '14 13:10 lmmenge

Yah, that makes sense. On further investigation the adafruit ez-key sends the same key with a keyUp event when its released. I know that this isn't how iCade operates. I'll see if I can write something for SiOS to handle this event structure.

It may end up using private members, but I have a apple dev account, so I can build it myself.... http://stackoverflow.com/questions/18747759/ios-7-hardware-keyboard-events http://nacho4d-nacho4d.blogspot.ca/2012/01/catching-keyboard-events-in-ios.html

Looks like it might be possible using public apis... http://blog.swilliams.me/words/2013/09/19/handling-keyboard-events-with-modifier-keys-in-ios-7/

One last thing.... can get keyups https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/ControllingtheCharacters/ControllingtheCharacters.html

Time to see if I can get it going!

On 13 October 2014 09:09, Lucas Menge [email protected] wrote:

@wiegerthefarmer https://github.com/wiegerthefarmer You need the down/up events separately for the current architecture (both the iOS front-end and the SNES9X back-end use that paradigm). Otherwise, how do we know when you're still holding the button down? How do we know when you have released it?

— Reply to this email directly or view it on GitHub https://github.com/lmmenge/SiOS/issues/4#issuecomment-58889328.

wiegerthefarmer avatar Oct 14 '14 13:10 wiegerthefarmer

This worked! https://gist.github.com/steventroughtonsmith/7515380 -(UIKeyCommand *)_keyCommandForEvent:(UIEvent *)event // UIPhysicalKeyboardEvent { NSLog(@"keyCommandForEvent: %@\n
type = %i\n
keycode = %@\n
keydown = %@\n\n", event.debugDescription, event.type, [event valueForKey:@"_keyCode"], [event valueForKey:@"_isKeyDown"]);

return  [UIKeyCommand keyCommandWithInput:nil modifierFlags:nil action:@selector(processKeyInput:)];

}

Put that code in iCadeReaderView.m, and you get very clear keyup and keydown events. :)

wiegerthefarmer avatar Oct 14 '14 16:10 wiegerthefarmer

@wiegerthefarmer Hmm. I'm not sure I like this approach. Since you built your own controller, can't you make it work like an iCade controller? Button down is sending one letter, button up is sending another letter? With your approach, we'd have to use private APIs and add another special case in the front-end just for this controller. I'd rather keep the codebase as clean as possible.

lmmenge avatar Oct 15 '14 03:10 lmmenge

I can try. The big issue is that the Adafruit EZ-key sends the standard keydown keyup events, and isn't compatible with iCade. I could probably add an arduino in the controller....

On 14 October 2014 23:00, Lucas Menge [email protected] wrote:

@wiegerthefarmer https://github.com/wiegerthefarmer Hmm. I'm not sure I like this approach. Since you built your own controller, can't you make it work like an iCade controller? Button down is sending one letter, button up is sending another letter? With your approach, we'd have to use private APIs and add another special case in the front-end just for this controller. I'd rather keep the codebase as clean as possible.

— Reply to this email directly or view it on GitHub https://github.com/lmmenge/SiOS/issues/4#issuecomment-59151477.

wiegerthefarmer avatar Oct 15 '14 13:10 wiegerthefarmer

Here's the string I got for 8bitdo's NES30 controller. Slightly different from the FC30:

wedcxzaqlvogythrjnufkpim

I appreciate the work out into supporting it!

DerekT07 avatar Dec 07 '14 03:12 DerekT07

@DerekT07 done in 1.4.5.

lmmenge avatar Dec 10 '14 22:12 lmmenge

I know the 8bitdo NES30 key map is given but here is my strings. They said the native mode for the 8bitdo NES30 is mode 2. I had problem using mode 2 on my iPhone 6. It wouldn't response for some reason even after chosen the correct controller in the app settings. I had to boot up on mode 3 for it to work. Here are my strings for the 8bitdo nes30.

8bitdo NES30 Mode 2 (as player one "Start+B" boot) cfdenoijhgkm

8Bitdo NES30 Mode 2 (as player two "Start+B+R" boot) The strings here was as it was set up. The up directional button made the cursor go up, the right directional button made the cursor goes right, down directional button made the cursor go down, left directional button made the cursor go left. Select button was a space and the start button brought the cursor down to the next line. The letter buttons yield as it was, "YBXALR".

8Bitdo NES30 Mode 3 (as single player "Start+A" boot) wedcxzaqlvogythrjnufkpim

I did these strings on my iPhone 6. I did not boot the 8Bitdo nes30 on any other modes because it was only designated for iOS on mode 2 and mode 3 only.

no2sc2 avatar Jan 01 '15 04:01 no2sc2

@no2sc2 MeSNEmu supports the NES30 in Mode 3 as of version 1.4.5 (DerekT07's Mode 3 string matches yours).

lmmenge avatar Jan 03 '15 21:01 lmmenge

Yes Lucas. I spoke to you about 2 player mode not working. I did a string test anyways so you can get an idea of the keys on mode 2. Maybe it'll help in future updates!

no2sc2 avatar Jan 03 '15 22:01 no2sc2

I have an ipega controller (http://www.amazon.com/Generic-Bluetooth-Controller-Wireless-Joystick/dp/B00AR9JEQU)

Its layout is different than a typical SNES controller, an and xy are switched. I have two strings for you.

This is hitting the x button on the controller as y, since the SNES has a y where the ipega has an x, etc wedcxzaqjnufythrimkp

This is the key sequence if I follow the instructions exactly, hitting the x where it shows on the controller. wedcxzaqythrjnufimkp

I hope that makes sense but if not, let me know.

acowinthecrowd avatar Jan 10 '15 16:01 acowinthecrowd

@acowinthecrowd just to be clear: if you ignore the letters written on your controller and just press the buttons that are in the same positions (spacially) as the real SNES controller, is this the resulting string? wedcxzaqjnufythrimkp

lmmenge avatar Jan 12 '15 19:01 lmmenge

That's correct, sorry to make it sound so confusing =)

acowinthecrowd avatar Jan 13 '15 00:01 acowinthecrowd

Hi, the following text is for a snakebyte controller: wedcxzaqlvogythrjnufimkp

Gohlan avatar Jan 13 '15 21:01 Gohlan

@Gohlan is that for this controller? http://www.snakebyte-europe.com/en/container-produkte/products/android/idroidcon/

lmmenge avatar Jan 14 '15 19:01 lmmenge

@acowinthecrowd I just noticed your strings are missing 4 letters. Could you confirm which keys you either don't have or your controller typing while you press?

lmmenge avatar Jan 14 '15 20:01 lmmenge

Hello,

Yes it is.

Emmanuel Lévy | +33 6 3378 6556 | Envoyé à partir de mon Windows Phone


De : Lucas Mengemailto:[email protected] Envoyé : ‎14/‎01/‎2015 20:56 À : lmmenge/MeSNEmumailto:[email protected] Cc : Gohlanmailto:[email protected] Objet : Re: [MeSNEmu] Add support for other iCade-like controllers (Submit your info here) (#4)

@Gohlan is that for this controller? http://www.snakebyte-europe.com/en/container-produkte/products/android/idroidcon/


Reply to this email directly or view it on GitHub: https://github.com/lmmenge/MeSNEmu/issues/4#issuecomment-69980402

Gohlan avatar Jan 14 '15 20:01 Gohlan

Text string for iPega PG-9025: wedcxzaqoglvjnufythrimkp http://www.dx.com/p/ipega-pg-9025-multimedia-bluetooth-controller-black-256612

naldin avatar Mar 14 '15 14:03 naldin

Pushed IPEGA PG-9025. Thanks @naldin ! Pushed Snakebyte idroid:con. Thanks @Gohlan !

lmmenge avatar Mar 14 '15 15:03 lmmenge