使用python更改键盘布局? [英] Change keyboard layout with python?

查看:108
本文介绍了使用python更改键盘布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用大学系统(Windows XP),并且想在登录时将键盘设置为Dvorak.我目前有一个可更改桌面图像的python脚本.

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.

我也可以使用python更改布局吗?还是还有其他方法?

Can I use python to change the layout as well? Or are there other ways?

推荐答案

更改键盘布局

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

对于德沃夏克(Dvorak):

and for Dvorak :

win32api.LoadKeyboardLayout("00010409",1)

win32api.LoadKeyboardLayout("00020409",1)

这篇关于使用python更改键盘布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆