Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

HowTo: Simulate an iCade controller for quick usage with an iOS device

Discussion in 'iOS and tvOS' started by VIC20, Nov 20, 2014.

  1. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
    For a VR setup I need an iOS game controller but usually I have no time and money to waste and if I want something then I want it immediately.

    So I thought it must be somehow possible to simulate an iCade controller via bluetooth by mapping the output of a normal USB gamepad to a virtual Mac keyboard and sending Macs keyboard output via bluetooth to the iOS device.

    That works fine. So I thought I share how this works :)

    What you need to simulate an iCade is:

    - ControllerMate to map the keys (up and down separated): http://www.orderedbytes.com/controllermate/

    - list of the keys used by iCade: http://gaming.stackexchange.com/questions/24774/icade-bluetooth-keyboard-mappings-for-mame

    - Type2Phone to simulate a bluetooth keyboard https://itunes.apple.com/de/app/type2phone/id472717129?mt=12

    - Gametel Gamepad plugin: https://www.assetstore.unity3d.com/en/#!/content/3814

    How to do it:

    - install Type2Phone on your Mac to connect your Mac keyboard with your iOS device via bluetooth.

    - map the gamepad's buttons in controller mate like shown on this picture (which shows 4 buttons only), you need to use the "NOT building block" to set a key when pressing the button down and a different key when releasing the button.



    ControllerMate has a limitation for mapping buttons when it is not registered, no idea if that is enough for setting up a whole gamepad. (I own a license anyway because it is just an awesome tool, so you should consider buying a license)

    Basically an iCade controller is just a bluetooth keyboard, the tricky thing is that when the user presses a button iCade sends for example "w" via bluetooth, when the user releases the stick iCade sends another key, in case of "d" the key send when releasing is "e"

    As you can see this works extremely well:

     
  2. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
  3. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
  4. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
    The hat switch of my game sux, but beside that it works really good: