Change keyboard layout with python?

前端 未结 3 401
旧巷少年郎
旧巷少年郎 2021-01-13 15:21

I\'m working on a college system (windows XP) and want to set the keyboard to Dvorak when I log on. I currently have a python script that changes the desktop image.

相关标签:
3条回答
  • 2021-01-13 15:40

    I would use AutoHotKey to change the layout. You could write a script remapping the keys and compile it as an executable file.

    For example

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

    etc.

    0 讨论(0)
  • 2021-01-13 15:46

    to 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)
    
    0 讨论(0)
  • 2021-01-13 15:53

    answer can be found at Programmatically change keyboard to Dvorak

    0 讨论(0)
提交回复
热议问题