Rockbox Technical Forums

Support and General Use => User Interface and Voice => Topic started by: tedd on December 06, 2015, 01:37:25 AM

Title: USB Keypad mode - game controller implementation difficulty?
Post by: tedd on December 06, 2015, 01:37:25 AM
Hey folks. I'm not entirely sure if this is the best place to post this question, but I don't think it would fit anywhere else.

Anyway, I've been thinking about other potential USB keypad modes. More specifically, I want to know how much they can be customized. While it may be slightly impractical, the novelty of using an MP3 player as a gamepad is somehow appealing to me.

My knowledge in C is very limited, so I'm wondering if somebody more fluent in it can tell me whether or not it's very difficult. So far, I've been able to customize the presentation layout in usb_keymaps.c, recompile Rockbox, and install it onto a Sansa Fuze. The custom keys work properly, but the issue that I've run into now is that keys do not act as if they are held down if the physical button is held down. This, of course, will not do for a gamepad.

After doing a little more digging around (looking at the model of the mouse mode), it looks like I would have to create custom defined actions in action.h and possibly modify action.c. This is now certainly beyond my knowledge in C. However, I'm sure that this kind of thing is possible, but I just don't know how difficult it would be for me to figure it out. Any insight would be appreciated!