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

Replace _glfwKeySym2Unicode with xkb_keysym_to_utf{8,32} #2444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LocalSpook
Copy link
Contributor

libxkbcommon already provides functions to convert keysyms to codepoints and UTF-8. The library has offered these functions since 0.5.0 (https://xkbcommon.org/doc/0.5.0/group__keysyms.html), so using them shouldn't cause any compatibility problems.

// size, because we know it won't use more than 5 bytes.
//
// See: https://github.com/xkbcommon/libxkbcommon/issues/418
if (xkb_keysym_to_utf8(keysyms[0], _glfw.wl.keynames[key], 7) <= 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd especially like comments on if this is okay.

@LocalSpook LocalSpook marked this pull request as draft December 10, 2023 14:53
libxkbcommon already provides functions to convert keysyms
to codepoints and UTF-8. The library has offered these
functions since 0.5.0 (https://xkbcommon.org/doc/0.5.0/group__keysyms.html),
so using them won't cause any compatibility problems.
@LocalSpook LocalSpook changed the title Replace _glfwKeySym2Unicode() with xkb_keysym_to_utf{8,32}() Replace _glfwKeySym2Unicode with xkb_keysym_to_utf{8,32} on Wayland Dec 10, 2023
@LocalSpook LocalSpook marked this pull request as ready for review December 10, 2023 16:18
@elmindreda elmindreda changed the title Replace _glfwKeySym2Unicode with xkb_keysym_to_utf{8,32} on Wayland Replace _glfwKeySym2Unicode with xkb_keysym_to_utf{8,32} Feb 4, 2024
@elmindreda elmindreda added enhancement Feature suggestions and PRs Wayland labels Feb 4, 2024
@elmindreda elmindreda self-assigned this Feb 4, 2024
@elmindreda elmindreda removed the request for review from linkmauve February 11, 2024 14:01
@elmindreda elmindreda added the input Keyboard, joystick or mouse label Feb 11, 2024
@elmindreda elmindreda added this to the 3.5 milestone Feb 15, 2024
@elmindreda elmindreda removed their assignment Mar 29, 2024
@dougbinks dougbinks self-assigned this Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestions and PRs input Keyboard, joystick or mouse Wayland
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants