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

Adds more special keys and key parsing #14

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

data-niklas
Copy link
Contributor

ParseKey returns a Key from a string. E.g.: "a" -> hotkey.KeyA. The second returned value indicates, if the Key was found.
Also added special keys:

  • Return
  • Escape
  • Delete
  • Tab
    Keycodes taken from linked posts / files.

Tested ParseKey on Linux. It at compiles, runs and at least works for "a" and "Return". Also tested KeyReturn.

It would be great to parse whole hotkeys from e.g.: Control + a.

Copy link
Member

@changkun changkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, I left a comment regarding the keycode conversion.

hotkey.go Outdated Show resolved Hide resolved
hotkey.go Outdated Show resolved Hide resolved
hotkey_linux.go Show resolved Hide resolved
hotkey.go Outdated Show resolved Hide resolved
Copy link
Member

@changkun changkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@changkun changkun merged commit a5dde31 into golang-design:main Apr 27, 2022
@data-niklas data-niklas deleted the keymap branch April 27, 2022 09:30
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.

None yet

2 participants