Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose window keyboard events to Tauri #12677

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

stijnfrishert
Copy link

@stijnfrishert stijnfrishert commented Feb 10, 2025

This PR implements #11671, which exposes keyboard input events for Tao in Tauri on the window-level.

To safeguard against breaking changes in Tao, I've opted to use types from keyboard-types as the public facing API in Tauri, and written converter functions in tauri-runtime-wry to move from one domain the the other.

Currently the PR exposes the following attributes:

  • Key state (pressed vs releases)
  • Logical key
  • Physical key
  • Location (Left/Right/etc.)
  • Is repeat?

Especially the logical and physical keys were a hassle, because both enums are alike, but there are subtle differences. I hope I've done the super -> meta conversion correct, and space needed special handling as well.

I have not done any testing, because I'm not sure how to do local Tauri testing.

Draft Questions

  • How should I handle converting non-exhaustive enums, such as ElementState and KeyLocation? Right now the converter function .expects(), but I'm not sure that's the most future -proof way of handling things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant