Zuzu-Typ / winput

winput Python extention - capture and send keyboard and mouse input on Windows
zlib License
28 stars 2 forks source link

Feature request: keyboard language detect and maybe change #6

Closed IGalat closed 2 years ago

IGalat commented 2 years ago

Hi again @Zuzu-Typ ,

Would be cool if winput could allow to detect current keyboard layout for active window, and (though less relevant) change it. Here's some code I've found for detection (another) and list of codes.

The idea for me is that I'll create e.g. "en-" and "fr-" keyboard layouts, and then if user wants text in french, I'll use this detect function, and if its language tag isn't "fr-XX", I'll switch until fr- is the language, and after that start typing. Here switching can be done either by another low-level function, or by combo such as win+space (or user-specified one), so for this it's not actually that important to have a switch functionality.

If you want, I'll translate that table of languages to enum and make and MR with it, so winput can give not just the code but all other data as well.

Zuzu-Typ commented 2 years ago

Hi there @IGalat

I'm sorry, but I think this is also a little out of scope for winput, as it's just supposed to be a rather low level interface to Windows' input system.

Sounds like it might be a good extension to have on it's own though (: