Tagged: android, controller, handebar, mapping
-
AuthorPosts
-
8 April 2024 at 8:35 pm #4418ganghouwer01Participant
Hello,
I am developing a handebar controller with 8 buttons. I got everything working but i am running into trouble on a particular device. When KEYCODE_F5 (198) is send, on the tablet i use, the SOS function is opened. It seems harcoded in the tablets android system and not possible to change. Is het possible to use another keycode to get function working? Is there a way to map them within DMD2?
Regards,
28 April 2024 at 10:44 pm #5096kdemotorsportsParticipantCan you share the key codes you have working? I tried KEY_UP, KEY_DOWN but they show DPAD_UP and DPAD_DOWN which doesn’t seem to be the same. Also should it be a bluetooth keyboard or a bluetooth gamepad?
2 May 2024 at 9:29 pm #5289ganghouwer01ParticipantIt should work using the ESP32 BLE Keyboard library, but as far as i remember you need to send the correct decimal values, for reference look at the following link:
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardmodifiers/
i am sending the following Key codes:
int KEYCODE_F5 = 198;
int KEYCODE_F6 = 199 ;
int KEYCODE_F7 = 200;
int KEYCODE_ENTER = 224;
int KEYCODE_DPAD_UP = 218;
int KEYCODE_DPAD_DOWN = 217;
int KEYCODE_DPAD_LEFT = 216;
int KEYCODE_DPAD_RIGHT = 215;2 May 2024 at 9:57 pm #5291kdemotorsportsParticipantThanks for the reply, I’ll give these key codes a try. I did manage to get the basics of up / down / left / right with the BleGamepad library. I’d love to get these others working too though. So thank you for the help.
17 June 2024 at 4:57 pm #7266Mikkel JørgensenParticipantAny updates on this, I have a list of keyCodes that almost works, they only one that doesn’t is the up and down function, and I can’t seem to find any that work for those two, I also tried the ble keyboard library and it doesn’t work either.
0x28, // Enter key
0x50, // DPAD Left
0x4F, // DPAD Right
0x52, // DPAD Up
0x51, // DPAD Down
0x3E, // F5 key
0x3F, // F6 key
0x40 // F7 key5 July 2024 at 9:54 am #7573João PereiraKeymasterI do not know what to reply here…
Keycodes are keycodes, you can check a list of all the Android Keycodes:
https://www.temblast.com/ref/akeyscode.htmWe use:
DPAD_UP, DOWN, LEFT, RIGHT
ENTER
F5
F6
F7BUT the app needs to “know” what controller you are using. If its an 8 button remote, try selecting the barbutton profile in the DMD controller selection setting.
DMD2 Project Manager & Lead Developer
Buy Me a Coffee5 July 2024 at 8:19 pm #7586Mikkel JørgensenParticipantThank you for a reference to the keycode map you use. I’m sorry to say there was no luck, I tried with Auto detect, 8 key generic and Bar buttons profiles. I only got some functionality on Auto Detect as before, this time it was on the DPAD_DOWN code 0x14 which resulted in a zoom in effect on the map. I stille had the best functionality width the key codes I used originally on Auto detect. I’m really at a loss for how to get this to work :(, Might just have to go and buy a controller insted off trying to integrate to the app myself.
5 July 2024 at 10:55 pm #7588ganghouwer01Participant<p style=”text-align: left;”>I can share my C/arduino code if you want. Maybe it will help u.</p>
Anyway, i did not find the solution for my original problem, in guess i will end up buying another tablet. -
AuthorPosts
- You must be logged in to reply to this topic.