GithubHelp home page GithubHelp logo

xkeysym's Introduction

xkeysyms

This crate provides constants representing all of the X11 keyboard symbols. It also provides utility functions for working with those symbols, and for converting between keyboard codes and keyboard symbols. This crate does not depend on a particular implementation of the X11 protocol and can therefore be used in any context where X11 keyboard symbols are needed.

In addition, this crate contains no unsafe code and is fully compatible with no_std environments.

MSRV Policy

The Minimum Safe Rust Version for this crate is 1.58.1.

Updating Headers

To update the automatically generated keyboard symbols in the automatically_generated.rs file, install Just and run just. The process creates a Debian Docker container in order to keep the files consistent, so make sure Docker is installed first.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be triple licensed as above, without any additional terms or conditions.

xkeysym's People

Contributors

dependabot[bot] avatar kchibisov avatar notgull avatar pentamassiv avatar wysiwys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xkeysym's Issues

Use NonZeroU32 as the backing type for Keysym

X11 generally uses the NO_KEYSYM value, as alias for zero, to denote that a keysym is not present. Therefore it would make sense to use a NonZeroU32 as the backing type for the Keysym type instead of u32. This way, for Option<Keysym> there is no ambiguity between None and Some(NO_KEYSYM).

Cons:

  • There may be a necessary difference between None and Some(NO_KEYSYM).
  • Requires raising the MSRV to 1.57 (although most of the windowing ecosystem is past that already so I wouldn't mind).

xkeysym::NO_SYMBOL not part of xkeysym::key

NO_SYMBOL is not part of the xkeysym::key module. This is a little unfortunate, because I need to use it and so far only have xkbcommon as an explicit dependency. xkbcommon does not export the NO_SYMBOL, so I would have to add xkeysym explicitly, or use Keysym(0). It would be more convenient, if I could use it just like all the other KeySym.

Match output of Keysym::name() with xdotools names

I am writing a library that uses xdotools to enter keys. In the documentation of the Keysym::name() fn it says:

Get a string corresponding to the name of this keyboard symbol.
The output of this function is **not stable** and is **intended for debugging purposes**.

Are there any thoughts to change this policy? It would be nice if I could use it. In order for the names to match, the "XK_" part would have to be removed.

Tracking issue for making xkeysym the source of truth for X11 keyboard symbols

It was suggested to make this crate serve as a "source of truth" for keyboard symbols across the Rust GUI ecosystem (between X11 and Wayland). This issue serves as a tracking issue for all PRs/issues I file to do this.

Repositories to file PRs against

I'll file draft PRs at first to make sure the interface checks out in all cases. Once I'm sure that we have the API that we want, I'll release xkeysym version 1.0.0 and mark all of these as ready.

Other matters

It was discussed that this repository should be moved to be under either @Smithay or @rust-windowing. Not sure what the organization admins' thoughts on that are. Done! It's been moved to @rust-windowing

I'll also ping @psychon and @eduardosm, since you've both expressed interest in unifying the X11 ecosystem (re as-raw-xcb-connection).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.