Skip to content

Feature: Add flag to emulate QWERTY in OTG mode#6748

Draft
levirak wants to merge 1 commit into
Genymobile:masterfrom
levirak:otg-emulate-qwerty
Draft

Feature: Add flag to emulate QWERTY in OTG mode#6748
levirak wants to merge 1 commit into
Genymobile:masterfrom
levirak:otg-emulate-qwerty

Conversation

@levirak
Copy link
Copy Markdown

@levirak levirak commented Apr 1, 2026

This may be a "me and only me" problem, but I got a solution working and figured I'd offer a preliminary pull request to see if there's any interest in it.

I have an old KaiOS dumb-phone (based on very old Android) that I'd appreciate being able to type on with a keyboard, because it's own input is atrocious. Unfortunately, I type Dvorak, and the device doesn't officially support external keyboards, so it only supports QWERTY input. In theory, this may also be a useful feature for AZERTY users, though I'm not one of them, so I'm not really in a position to know. Nor am I in a position to test if this implementation behaves appropriately under AZERTY.

Here's a solution to my problem that sends the QWERTY scancode that corresponds with the keycode SDL2 reports. I do this with a simple, hard-coded lookup table. While SDL2 does have a SDL_GetScancodeFromKey that turns keycodes into scancodes, it is for the current keymap, and I'm not seeing a way to ask for that mapping in a different (e.g. QWERTY) layout. I added a --otg-emulate-qwerty CLI flag to activate the feature. It's meant to only be used alongside --otg, but that could change.

If there's any interest in this, I could polish this PR up some more, especially with style and implementation advice from more knowledgeable contributors.

Reasons why you might not want this PR: As I said, this is likely a "me and only me" problem. If so, adopting this feature may incur a support cost that's just not worth the extra feature.

Add the flag `--otg-emulate-qwerty` to allow for behaving as though the
controlled QWERTY-expecting device had the local keymap.
@levirak levirak changed the title Add flag to emulate QWERTY in OTG mode Feature: Add flag to emulate QWERTY in OTG mode Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant