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

Wayland input handling #7857

Merged
merged 13 commits into from
Feb 16, 2024
Merged

Wayland input handling #7857

merged 13 commits into from
Feb 16, 2024

Conversation

witelokk
Copy link
Contributor

@witelokk witelokk commented Feb 15, 2024

Adds initial keyboard and mouse input for Wayland (thanks to @gabydd and @kvark for reference).

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 15, 2024
@witelokk witelokk marked this pull request as draft February 15, 2024 20:40
@maxdeviant maxdeviant changed the title Walyland input handling Wayland input handling Feb 15, 2024
@mikayla-maki mikayla-maki self-assigned this Feb 15, 2024
@Titaniumtown Titaniumtown mentioned this pull request Feb 16, 2024
12 tasks
@witelokk
Copy link
Contributor Author

So for now:

  • double/triple clicks don't work (it is quite tricky to implement as it requires buffering mouse events and detect single/double/triple clicks based on timings)
  • holding keys doesn't work
  • shortcuts generally work though for some shorcuts (ig unbinded) it types key name instead
  • ime not implemented (don't even know what it is)
  • scrolling is a bit sluggish
  • touch inputs are not implemented
  • other things should work

@witelokk witelokk marked this pull request as ready for review February 16, 2024 20:14
@mikayla-maki mikayla-maki merged commit f82b274 into zed-industries:main Feb 16, 2024
6 checks passed
@mikayla-maki
Copy link
Member

Thank you!

@jansol
Copy link
Contributor

jansol commented Feb 16, 2024

@witelokk IME stands for Input Method Editor, i.e. the mechanism that lets you input more complex text than the keyboard can handle directly. You might be familiar with the macOS "press-and-hold for accented characters", that uses this mechanism. Aside from that, CJK text is generally entered with an IME (you can see how that works e.g. on google translate by setting the input language to Japanese, activating the input method by clicking the あ icon and typing "sushi" in the input box). I think dead keys / compose key input might also be handled via the IME mechanism?

@teohhanhui
Copy link

Is there a reason why libinput is not being used?

https://wayland.freedesktop.org/libinput/doc/latest/index.html

@rajveermalviya
Copy link
Contributor

Is there a reason why libinput is not being used?

https://wayland.freedesktop.org/libinput/doc/latest/index.html

libinput isn't supposed to be used by wayland clients, it's for wayland compositors. wayland clients receive input events via wl_keyboard, wl_pointer, wl_touch events.

And for IME, there's https://wayland.app/protocols/text-input-unstable-v3.

@witelokk witelokk deleted the walyland-input2 branch February 17, 2024 08:03
@davidsmfreire
Copy link

I'm willing to help implement shortcuts. Could someone link me a Discord server where discussion for linux contributions is happening? Thank you.

@witelokk
Copy link
Contributor Author

I'm willing to help implement shortcuts. Could someone link me a Discord server where discussion for linux contributions is happening? Thank you.

Shortcuts do actually work, but there's no Linux keymap yet. For Discord, there's a link in gpui crate README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants