Skip to content

Lex98/py_win_keyboard_layout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py_win_keyboard_layout

Interaction with keyboard layout on windows. Tested only on windows 7 x64 with pywin32 build 220

Dependency

pywin32

Usage

Install the PyPI package:

$ sudo pip install py_win_keyboard_layout

or clone the repository (no installation required, source files are sufficient):

$ git clone https://github.com/Lex98/py_win_keyboard_layout

Then check the API docs to see what features are available.

Example

import py_win_keyboard_layout

# change foreground window keyboard layout to russian
py_win_keyboard_layout.change_foreground_window_keyboard_layout(0x04190419)

API

Table of Contents

Returns foreground window keyboard layout as integer

Examples:

py_win_keyboard_layout.get_foreground_window_keyboard_layout() -> 68748313 - 0x04190419 - russian
py_win_keyboard_layout.get_foreground_window_keyboard_layout() -> 67699721 - 0x04090409 - english

Change foreground window keyboard layout

Parameter:

  • layout_id=0 : integer Integer containing a locale id, eg 68748313 - 0x04190419 - 0x419 - russian. Default change layout like Ctrl+Shift or Alt+Shift

Return Value:

  • Returns True if layout is changed and win32api.SendMessage() output if not

Returns a tuple of all locale ids currently loaded

Example:

py_win_keyboard_layout.get_keyboard_layout_list() -> (68748313, 67699721)

Loads a new locale id

Parameters:

  • string_layout_id : string. Hex string containing a locale id, eg "00000409"

  • Flags=0 : int. Combination of win32con.KLF_* constants. See more information in MSDN

Example:

KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_REORDER == 0x109 == 265
py_win_keyboard_layout.load_keyboard_layout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_REORDER)
py_win_keyboard_layout.load_keyboard_layout("00000409", 0x109)
py_win_keyboard_layout.load_keyboard_layout("00000409", 265)

Return Value:

  • Returns the integer locale id that was loaded

Example:

py_win_keyboard_layout.load_keyboard_layout("00000409") -> 67699721 for english

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages