Skip to main content

Python bindings for libxkbcommon using cffi.

Example usage:

>>> from xkbcommon import xkb
>>> ctx = xkb.Context()
>>> keymap = ctx.keymap_new_from_names()
>>> state = keymap.state_new()
>>> state.led_name_is_active("Caps Lock")
False
>>> capslock = 66
>>> str(state.update_key(capslock, xkb.XKB_KEY_DOWN))
'StateComponent.XKB_STATE_MODS_DEPRESSED|XKB_STATE_MODS_LOCKED|XKB_STATE_MODS_EFFECTIVE|XKB_STATE_LEDS'
>>> str(state.update_key(capslock, xkb.XKB_KEY_UP))
'StateComponent.XKB_STATE_MODS_DEPRESSED'
>>> state.led_name_is_active("Caps Lock")
True

Version numbering

From release 0.5 onwards, the version numbering of this package will relate to releases of libxkbcommon as follows:

If the Python package version is major.minor[.patch] then it requires at least release major.minor.0 of libxkbcommon to build and run, and should work with any subsequent release. The patch version of the Python package is unrelated to the patch version of libxkbcommon.

In practice this means that you should always specify a maximum version when depending on xkbcommon.

  • Most users should specify xkbcommon<1.1

  • If you need to use xkb.Context(no_secure_getenv=True) then specify xkbcommon<1.6

  • If you need to iterate over an xkb.ComposeTable instance then specify xkbcommon<1.7

Metadata

Release files for xkbcommon 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xkbcommon 1.5.1
File Size Uploaded Provenance Actions
xkbcommon-1.5.1.tar.gz 80.2 kB Without provenance Details for xkbcommon-1.5.1.tar.gz

Release files / xkbcommon-1.5.1.tar.gz

Download URL xkbcommon-1.5.1.tar.gz
Size 80.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac174808dbf61d35d9da804bf33baac74bc6f2be0c108594ae93c79cd15ddc36
BLAKE2b-256 checksum
How to use checksums
bff66f304689f619323bfa64a8f3777da7b3108fdd513b6bf66e9438bf1c8a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for xkbcommon 1.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page