Change keyboard layout with python?

I am working on a college system (Windows XP) and want to install the keyboard on Dvorak when I log in. I currently have a python script that changes the desktop image.

Can python be used to change layout? Or are there other ways?

+2
source share
3 answers

Change keyboard layout

import win32api
win32api.LoadKeyboardLayout('00000409',1) # to switch to english
win32api.LoadKeyboardLayout('00000401',1) # to switch to arabic

and for Dvorak:

win32api.LoadKeyboardLayout("00010409",1)

or

win32api.LoadKeyboardLayout("00020409",1)
+3
source
+1
source

I would use AutoHotKey to change the layout. You can write a script to reassign keys and compile them as an executable.

for example

q::'
+q::"
w::,
+w::<
e::.
+e::>
r::p

and etc.

+1
source

Source: https://habr.com/ru/post/1535756/


All Articles