Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: dprossner on June 05, 2022, 06:52:44 PM

Title: Custom USB keypad Profiles
Post by: dprossner on June 05, 2022, 06:52:44 PM
I know this is a long shot I would love to be able to change the commands sent by my device in USB keypad mode or add more profiles with different commands than the ones baked in. If this is already possible, I apologize, but I couldn't find any info on how to do this online. I would love to be proven wrong but if I'm not this feature would be incredibly useful.
Title: Re: Custom USB keypad Profiles
Post by: Frankenpod on June 05, 2022, 07:55:09 PM
Not that I really understand any of it, but it sounds as if that's what this patch was about

https://gerrit.rockbox.org/r/c/rockbox/+/1212

I really don't know anything about it, but it stuck in my mind because it sounds like something that could potentially be a vector for malware!
Title: Re: Custom USB keypad Profiles
Post by: dprossner on June 05, 2022, 08:51:59 PM
hmm, I could see how malware may be a concern, but no more than plugging in a phone to a pc. I was just thinking brightness controls using a scroll wheel and an alt f4 shortcut or something. ill take a look at the link you provided
Title: Re: Custom USB keypad Profiles
Post by: gevaerts on June 07, 2022, 05:23:11 AM
I don't see how this is a vector for malware unless the config isn't under your control. If you're worried about someone else's device, sure, that is an issue, but then this doesn't really change that, someone else's device is dangerous by definition.
Title: Re: Custom USB keypad Profiles
Post by: Frankenpod on June 08, 2022, 04:14:24 AM
I'm only saying in _theory_ this could be used for nefarious purposes.  Not that it's a real risk to the owner of the ipod.

As I understand it, such 'rubber ducky' applications are effectively tricking the computer into thinking a USB storage device is actually a keyboard, so can bypass restrictions on executing programs from such storage devices.  In _theory_ you could plug your innocent-looking ipod into Dr Evil's secret-lair's computer, and have it execute a script, as if you were typing it from the keyboard.

Mildly curious whether that patch makes possible the sort of thing the OP was asking about.
Title: Re: Custom USB keypad Profiles
Post by: Bilgus on June 08, 2022, 09:54:18 PM
I think the new keyremap plugin would enable this but only as far as existing usb commands I guess between this and the referenced patch you'd probably be close
Title: Re: Custom USB keypad Profiles
Post by: __builtin on June 12, 2022, 02:22:46 AM
Yeah, you could write a couple of Ducky scripts to press the right keys, and execute them from the file browser. I haven’t touched that patch in years though, so no guarantee it even builds at this point.