Skip to content Skip to sidebar Skip to footer

Automatically Change Keyboard Layout In Winxp

i want to change keyboard language from english to arabic in python on windows XP, like i have two line edit , write on first one in english and when move to second line edit langu

Solution 1:

You are describing a non trivial task. There is - afaik - no standard python package/module to support multi-language keyboard-layouts for various operating systems. It depends on your OS and the used IME (Input Method Engine). Under linux you might use the ibus-bindings or use a system-tool to change the layout. Under windows (which im not familar with) you might consider this post Win32 Api access to keyboardlayout which uses a win32-api call to change the keyboard layot.

I updated my answer, by copying the relevant section from the comment of the OP, just to help users with a similar question:

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

Solution 2:

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

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

Post a Comment for "Automatically Change Keyboard Layout In Winxp"