moolticute icon indicating copy to clipboard operation
moolticute copied to clipboard

Entering recorded data regardless of system layout

Open EugeneRymarev opened this issue 2 years ago • 7 comments

Missing feature

https://github.com/mooltipass/minible/issues/413

Justification

This update will help make the device easier to use for those who have more than one layout on their system.

This will also allow you to enter credentials with mixed layouts.

Workarounds

Manual layout switching

EugeneRymarev avatar Oct 17 '23 16:10 EugeneRymarev

The idea is cool, not sure if possible tho for moolticute to grab the current keyboard layout (and let's not get me started with IME states of eg a japanese setup)

Don't forget the system sees the mp device primarily as a keyboard and a keyboard just sends scancodes, which the computer then interprets against the layout table)

My1 avatar Oct 17 '23 16:10 My1

for that use case we'd need moolticute to simulate key presses in the currently opened program.

limpkin avatar Oct 25 '23 20:10 limpkin

or maybe even better if we have MC anyway, couldnt MC just populate the input field directly (with the added bonus that you wouldnt need to care about the current keymap at all)? otherwise if MC can just read out the current key map and transmit that to the MP the MP would stay doing its keyboarding but with the layout awareness (although obviously no idea if a program can fetch the current keymap)

also an added annoyance of MC-based key input is that elevated windows wouldnt work unless MC itself is also elevated (not sure if that's a good idea in general), if MC can grasp the kb layout and relay that to the MP that wouldnt need to interact with elevated processes

My1 avatar Oct 25 '23 22:10 My1

I looked a little bit into this issue. Qt has a KeyboardLayoutChanged Event that MC the daemon can catch as well as it can query the system for the keyboard layout. This isn't something you can do via pure HID class.

So as it seems, the logic would be: Send a request to MC to notify we're about to type something, so that it can switch layouts via simulated keypress or directly (there seems to be the API). Then type it.

Or just inject the text via MC, when it's connected, instead of HID. However this would not work right in cases when you're running multiple VTs on Linux (this case should be handled carefully)

nekromant avatar Jul 27 '24 21:07 nekromant

this is news to me... could we actually have moolticute automatically detect a person's layout and configure the mini accordingly? we would prompt the user if we'd detect a mismatch

limpkin avatar Jul 29 '24 18:07 limpkin

Honestly i don't know all oses and what they allow

But windows apparently has this for example.

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeyboardlayout

My1 avatar Jul 29 '24 19:07 My1

that could be quite useful.... pinging @deXol

limpkin avatar Jul 29 '24 19:07 limpkin