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

Native mode #25

Open
robiot opened this issue Mar 21, 2022 · 7 comments
Open

Native mode #25

robiot opened this issue Mar 21, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@robiot
Copy link
Owner

robiot commented Mar 21, 2022

A mode that uses uinput to send mouse events. This will work in wayland, but probably require root.

@robiot robiot added the enhancement New feature or request label Mar 21, 2022
@robiot
Copy link
Owner Author

robiot commented Jun 2, 2022

Maybe have a daemon running that handles all virtual input stuff?

@robiot
Copy link
Owner Author

robiot commented Jun 7, 2022

This would be very complicated since almost everything builds on X's apis. :\

@nm004
Copy link

nm004 commented Jun 21, 2022

Hi @robiot. Thank you for your great work 👍

I have news for you.

There are two wayland protocol extensions to get the state of input device (zwlr_virtual_pointer_v1, org_kde_kwin_fake_input), but they are compositor specific protocols (wlroots and KDE). There is another emulated input library called libei. But libei is still WIP, and needs an emulated input sever in wayland compositor. Currently, only GNOME has implemented it, but the commit has not yet be merged (https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1436).

Uinput is another option, though it requires root permission (more precisely, read/write permissions for /dev/uinput and read permission for /dev/input/event*). Unfortunately, it has ~30hz rate limit for clicking. It is becuase libinput manages inputs and it looks like dealing with button bouncing.

Working virtual input in wayland is still a long way to go...

@robiot
Copy link
Owner Author

robiot commented Jun 22, 2022

Hi @robiot. Thank you for your great work +1

I have news for you.

There are two wayland protocol extensions to get input devices' state (zwlr_virtual_pointer_v1, org_kde_kwin_fake_input), but they are compositor specific protocols (wlroots and KDE). There is an another emulated input library called libei. But libei is still WIP, and needs an emulated input sever in wayland compositor. Currently, only GNOME has implemented it, but the commit is still not be merged (https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1436).

I wrote a auto click program using uinput (https://gist.github.com/nm004/e34b40ef3c2ab3ab8ec3eab2376ca7ab). It requires root, of course (set read/write permission for /dev/uinput and set read permission for /dev/input/event*). My program works well for my needs, but it has ~30hz rate limit for clicking. It is becuase, in wayland, (mostly) libinput manages inputs and it deal with button bouncing (I'm not 100% sure, sorry). My program simulates clicking with an uinput device, so the click events are handled by libinput.

Working virtual input in wayland is still a long way to go...

Yep, it's sad that there isn't a nice way to do it, like you can in X. I looked into libei and it seemed kinda nice. But XClicker don't just send clicks. It also has the hotkey listener, mouse position chooser and hotkey chooser which all use X's APIs.

I think the easiest thing to do here, would be to create a daemon, xclickerd or something, that provides the functionality to simulate mouse clicks and get key/mouse presses.

@twisted-nematic57
Copy link

I need this. GDM is being stubborn and refuses to boot into Xorg mode.

@wolf-yuan-6115
Copy link

Screencast from 2023-01-03 18-46-46.webm
Hmm Xclicker on Wayland is working for me

@KotoWhiskas
Copy link

Screencast from 2023-01-03 18-46-46.webm Hmm Xclicker on Wayland is working for me

Because both XClicker and Brave use xwayland

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

No branches or pull requests

5 participants