CapsLockIndicator
CapsLockIndicator copied to clipboard
Keyboard layout indicator
Hello. Is it possible to add a keyboard layout indicator when enabling a layout other than the default one?
Doesn't Windows already come with an input indicator?
Doesn't Windows already come with an input indicator?
It is very small and not noticeable. It would be nice if there would be the same notification with a different layout. I use the on-screen notification mode when Num Lock, Caps Lock, and Scroll Lock are on.
I have taken another look at it and implementing this seems to be a huge undertaking, as there is a) no managed function to retrieve the current keyboard layout, so p/invoking would be necessary and b) the keyboard layout is set on a per-thread basis, thus making it really difficult to retrieve the keyboard layout for any given process.
I now have a homemade app on AutoHotkey. A narrow red stripe above the taskbar if a different layout. Maybe something will help.
Color1 := "0x0C0BC0", Color2 := "f00000", x := 0, y := 718, w := 1400, h := 6
loop
{
If (InputLayout() = "English")
{
Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound
Gui, Color, % Color2
Gui, Show, x%x% y%y% w%w% h%h% NA
}
else
Gui Destroy
sleep, 50
}
InputLayout()
{
ThreadID := DllCall("GetWindowThreadProcessId", "Int", WinExist("A"), "Int", 0)
HKL := DllCall("GetKeyboardLayout", "uint", ThreadID, "UShort")
VarSetCapacity(sKbd, 260, 0)
DllCall("GetLocaleInfo", "uint", HKL
, "uint", 0x1001
, "str", sKbd
, "uint", 260)
Return sKbd
}
qvlm_This_and_next_line_added_by_Ahk2Exe:
Exit
The key components seem to be GetWindowThreadProcessId
, GetKeyboardLayout
and GetLocaleInfo
. I will put this on my backlog, although with low priority. Meanwhile, this will be available for anyone who is interested; pull requests are welcome!
Thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.