@Scott-Sumner said:
@Mikhail-V said:
…read the current keyboard layout. This will require some WinAPI calls to the system. Probably it is possible, but I don’t know how to do it from Pythonscript.
For purely educational purposes, here’s a way:
import ctypes buff = ctypes.create_unicode_buffer(1024) ctypes.windll.user32.GetKeyboardLayoutNameW(buff) console.write(buff.value)
This sort of works, but on windows 10 there is same issue as with AHK - it detects the layout
only once when the application starts, but when I switch the layout and repeat the script -
it returns same code value regardless of current layout.