I have several Bluetooth gamepads. It would be nice if default button mappings could be added for them. I tested using a Huawei Y300 phone which runs Android 4.1.1.
If the ability to map multiple keys to the same console button (issue #44) is implemented, you could map all buttons so the controllers work whether set to gamepad or keyboard mode.
Mayflash AD001 PS2 Controller Bluetooth Adaptor
http://www.mayflash.com/products/iphoneipad/ad001.html
This product allows PlayStation 2 controllers to be connected via Bluetooth. Like various other Bluetooth controllers it has several modes: gamepad, keyboard and iCade.
Key codes for gamepad, keyboard, iCade modes:
D-pad U/D/L/R: POV Up/Down/Left/Right, w/s/a/d, we/xz/aq/dc
Left analog stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+, Up/Down/Left/Right arrows, we/xz/aq/dc
Right analog stick U/D/L/R: Y Axis- 2/Y Axis+ 2/X Axis- 2/X Axis+ 2, i/k/j/l, [none]
L1: L1, 5, im
L2: L2, 7, og
L3 (left stick button): C, og
R1: R1, 6, kp
R2: R2, 8, lv
R3 (right stick button): Z, 0, lv
Select: Select, Backspace, og
Start: Start, Enter (keyboard Return), lv
Cross: A, 2, hr
Circle: B, 3, uf
Square: X, 1, yt
Triangle: Y, 4, jn
OnLive Universal Wireless Controller
Picture:
http://4.bp.blogspot.com/-sdEup_tSB08/UKU_f1BQ_dI/AAAAAAAACsE/ArKeyygM3OQ/s1600/universal_onlive_wireless_controller.jpg
This dual-mode controller can work over Bluetooth, or via a proprietary(?) protocol with the included USB adapter. Up to four controllers can be paired with the USB adapter.
Bluetooth device name: "OnLive Wireless Controller"
USB adapter device names as shown in Snes9x-EX:
OnLive OnLive Wireless Adapter
OnLive OnLive Wireless Adapter #2
OnLive OnLive Wireless Adapter #3
OnLive OnLive Wireless Adapter #4
The left and right triggers (LT and RT) are analog, but also report key codes when fully pressed. On my controller at least, I have to press them quite hard to get the key codes.
Long-pressing the OnLive button turns the controller off.
The "^" button is used for pairing the controller. You press ^ and the OnLive button to initiate pairing. In Snes9x-EX the ^ button is not recognised/detected, so it's not possible to map it. However I used Gamepad Tester (https://play.google.com/store/apps/details?id=com.chiarly.gamepad), which reports the ^ button generating keycode 0 presses and releases. Keycode 0 = KEYCODE_UNKNOWN ???
[I used usbhid-dump to dump the HID data stream and can post info on which bit corresponds to ^ and other buttons if it will help. But maybe the Android emulators don't work at that low a level?]
D-pad U/D/L/R: POV U/D/L/R
Left analog stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+
Right analog stick U/D/L/R: Y Axis- 3/Y Axis+ 3/X Axis- 3/X Axis+ 3
Left stick button: L-Thumb
Right stick button: R-Thumb
LB: L1
LT: X Axis+ 2, keycode 0x59 (KEYCODE_MEDIA_REWIND) when fully pressed
RB: R1
RT: Y Axis+ 2, keycode 0x5A (KEYCODE_MEDIA_FAST_FORWARD) when fully pressed
Select: Select
Start: Start
A/B/X/Y: A/B/X/Y
OnLive: Mode
<<
: 0x59 (KEYCODE_MEDIA_REWIND)
>>
: 0x5A (KEYCODE_MEDIA_FAST_FORWARD)
o
: 0x82 (KEYCODE_MEDIA_RECORD)
>||
: 0x55 (KEYCODE_MEDIA_PLAY_PAUSE)
^
: 0x00 (KEYCODE_UNKNOWN)
MOGA Hero Power
http://www.mogaanywhere.com/controllers/heropower
Pictures:
http://www.androidrundown.com/wp-content/uploads/2013/11/MOGAHEROPOWER-5.jpg
http://www.androidrundown.com/wp-content/uploads/2013/11/MOGAHEROPOWER-4.jpg
This controller can be set to two modes. Mode A requires the Moga Pivot app and seems to have worse latency than mode B. Mode B functions as a standard HID gamepad.
The mode A Bluetooth device name is "Moga 2", mode B name is "Moga 2 HID"
Bit 7 of the fourth byte of the Bluetooth address is 0 when the controller is in mode A, 1 when in mode B.
In mode B all buttons function as expected, except the left analog stick button is Back (not L-Thumb).
Terios T-5
Picture:
http://g03.a.alicdn.com/kf/HTB1TFkeIpXXXXaiXFXXq6xXFXXX7/2015-Hot-Sell-T5-Wireless-Bluetooth-Gamepad-Gaming-Game-Controller-BT-3-0-Joystick-with-Stand.jpg
This controller can be used in gamepad, keyboard and iCade modes.
Bluetooth device name: "Bluetooth Gamepad"
# hcitool inq
Inquiring ...
00:17:00:00:1A:3D clock offset: 0x2851 class: 0x002540
# hcitool info 00:17:00:00:1A:3D
Requesting information ...
BD Address: 00:17:00:00:1A:3D
Device Name: Bluetooth Gamepad
LMP Version: 3.0 (0x5) LMP Subversion: 0xc
Manufacturer: not assigned (771)
Features page 0: 0xbf 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Features page 2: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
When in gamepad, keyboard, iCade modes:
D-pad U/D/L/R: POV U/D/L/R, w/s/a/d, we/xz/aq/dc
Left stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+, Up/Down/Left/Right [arrows], we/xz/aq/dc
Right stick U/D/L/R: Y Axis- 2/Y Axis+ 2/X Axis- 2/X Axis+ 2, i/k/j/l, [none]
Left stick button: Back (same for all three modes)
Right stick button: Enter (same for all three modes)
Select: Select, Backspace, og
Start: Start, Enter, lv
A/B/X/Y: A/B/X/Y, 2/3/1/4, hr/jn/yt/uf
LB: L1, 5, im
LT: L2, 7, og
RB: R1, 6, kp
RT: R2, 8, lv
The ipega controllers have gamepad, keyboard and iCade modes. Keys below are shown for gamepad, keyboard then iCade modes. The controllers' four action buttons (A/B/X/Y) are in the same relative positions as on an Xbox controller.
ipega PG-9017S
Small controller with extending holder for phone. Only a single pair of shoulder buttons (L/R). Small analog sticks do not have buttons.
Picture: http://img.alibaba.com/img/pb/948/539/574/574539948_586.jpg
Bluetooth device name: "ipega gamepad controller"
# hcitool inq
Inquiring ...
00:17:02:01:15:FE clock offset: 0x1722 class: 0x002540
# hcitool info 00:17:02:01:15:FE
Requesting information ...
BD Address: 00:17:02:01:15:FE
Device Name: ipega gamepad controller
LMP Version: 3.0 (0x5) LMP Subversion: 0xc
Manufacturer: not assigned (771)
Features page 0: 0xb7 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Features page 2: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
D-pad U/D/L/R: POV U/D/L/R, Up/Down/Left/Right arrows, we/xz/aq/dc
Left analog stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+, Up/Down/Left/Right arrows, we/xz/aq/dc
Right analog stick U/D/L/R: Y Axis- 2/Y Axis+ 2/X Axis- 2/X Axis+ 2, [none], [none]
L: L1, q, im
R: R1, p, kp
Select: L2, r, [none]
Start: R2, y, [none]
A/B/X/Y: A/B/X/Y, j/k/m/i, uf/hr/jn/yt
ipega PG-9023
Extending/telescopic controller, tablet/phone can fit in the middle.
Picture:
http://i01.i.aliimg.com/wsphoto/v2/32225206219_3/Newest-iPega-PG-9023-Wireless-Bluetooth-Game-Pad-Controller-For-Cellphone-Tablet-iPod-PC-Game-Console.jpg
Bluetooth device name: "ipega Extending Game Controller"
# hcitool info 58:6B:2B:9A:A8:2F
Requesting information ...
BD Address: 58:6B:2B:9A:A8:2F
Device Name: ipega Extending Game Controller
LMP Version: 3.0 (0x5) LMP Subversion: 0xc
Manufacturer: not assigned (771)
Features page 0: 0xbf 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Features page 2: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
D-pad U/D/L/R: POV U/D/L/R, w/s/a/d, we/xz/aq/dc
Left analog stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+, Up/Down/Left/Right arrows, we/xz/aq/dc
Right analog stick U/D/L/R: Y Axis- 2/Y Axis+ 2/X Axis- 2/X Axis+ 2, i/k/j/l, [none]
L: L1, 5, im
L2: L2, 7, og
Left stick button: L-Thumb, 9, og
R: R1, 6, kp
R2: R2, 8, lv
Right stick button: R-Thumb, 0, lv
Select: Select, Backspace, og
Start: Start, Enter, lv
A/B/X/Y: A/B/X/Y, 2/3/1/4, hr/uf/yt/jn
The five media buttons have the same function in all three modes:
Vol-: Vol Down
Vol+: Vol Up
Skip back: 0x58 = KEYCODE_MEDIA_PREVIOUS
Skip forward: 0x57 = KEYCODE_MEDIA_NEXT
Play/Pause: 0x55 = KEYCODE_MEDIA_PLAY_PAUSE
ipega PG-9025
Controller with extending holder for phone. Successor model to PG-9017S? Two full-size analog sticks with buttons. Two pairs of shoulder buttons; L2 & R2 are on the back of the controller.
Picture:
http://ecx.images-amazon.com/images/I/61ek9p4PRYL._SL1000_.jpg
Bluetooth device name: "ipega media gamepad controller"
# hcitool inq
Inquiring ...
00:17:02:01:00:01 clock offset: 0x686c class: 0x002540
# hcitool info 00:17:02:01:00:01
Requesting information ...
BD Address: 00:17:02:01:00:01
Device Name: ipega media gamepad controller
LMP Version: 3.0 (0x5) LMP Subversion: 0xc
Manufacturer: not assigned (771)
Features page 0: 0xb7 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Features page 2: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
D-pad U/D/L/R: POV U/D/L/R, w/s/a/d, we/xz/aq/dc
Left analog stick U/D/L/R: Y Axis-/Y Axis+/X Axis-/X Axis+, Up/Down/Left/Right arrows, we/xz/aq/dc
Right analog stick U/D/L/R: Y Axis- 2/Y Axis+ 2/X Axis- 2/X Axis+ 2, i/k/j/l, [none]
L1: Y, 5, im
L2: L1, 7, og
Left stick button: L-Thumb, 9, og
R1: Z, 6, kp
R2: R1, 8, lv
Right stick button: R-Thumb, 0, lv
Select: L2, Backspace, og
Start: R2, Enter (keyboard Return), lv
A: B, 2, hr
B: C, 3, uf
X: A, 1, yt
Y: X, 4, jn
The five media buttons have the same function in all three modes:
Vol-: Vol Down
Vol+: Vol Up
Skip back: 0x58 = KEYCODE_MEDIA_PREVIOUS
Skip forward: 0x57 = KEYCODE_MEDIA_NEXT
Play/Pause: 0x55 = KEYCODE_MEDIA_PLAY_PAUSE