Skip to content

Conversation

@kdj0c
Copy link
Collaborator

@kdj0c kdj0c commented Nov 4, 2025

Add support for mouse / touchpad / virtual mouse on VM.

It is based on my rotation support PR #147

  • Basic mouse support

  • Touchpad support

  • Virtual mouse support with absolute coordinate

  • Select/Copy/Paste

  • Scroll with the wheel

  • Hide mouse pointer when not used

  • gltex renderer

  • pixman renderer

  • bbulk renderer

  • bblit renderer

Fix #54

@kdj0c kdj0c force-pushed the pointer_support branch 4 times, most recently from 96dbc62 to 3d2703c Compare November 14, 2025 09:08
@kdj0c
Copy link
Collaborator Author

kdj0c commented Nov 14, 2025

@MacSlow, if you have time to review or test it?

For testing you will need:

  • libtsm 4.3.0 that I just released, for the new word selection API (This can't be done correctly on kmscon side).
  • Add "mouse" in /etc/kmscon/kmscon.conf, or start kmscon with --mouse.

I prefer to not enable mouse support by default, as it's a bit experimental.

The main differences with your implementations:

  • The mouse cursor is smoother (It is drawn at pixel precision).
  • It re-use the input subsystem using evdev, and should work with seats.
  • It supports virtual pointer, so it works great in qemu VM.

@Conan-Kudo
Copy link

Keep in mind that we'd probably want this enabled in Fedora since there would be no other way to have mouse support.

@kdj0c
Copy link
Collaborator Author

kdj0c commented Nov 14, 2025

Keep in mind that we'd probably want this enabled in Fedora since there would be no other way to have mouse support.

gpm or consolation are not enabled by default in Fedora.
So I don't think it's a problem to require editing /etc/kmscon/kmscon.conf to enable mouse support.

@kdj0c kdj0c force-pushed the pointer_support branch 3 times, most recently from 4b6f2e4 to acceb9e Compare November 19, 2025 23:19
Jocelyn Falempe added 7 commits November 21, 2025 14:14
Prepare work to support other input devices like mouse, touchpad...

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
This prepare the work to have a different hook for pointer events

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
In gltex_draw(), add gl_x1, gl_x2, gl_y1, gl_y2,
to store vertex coordinate.

This is cosmetic and should have no impacts.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
This allows to draw a mouse pointer at specific location

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Jocelyn Falempe added 10 commits November 24, 2025 15:05
Start support for standard mouse, using relative EV_REL events

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
input_pointer needs to know the screen size in pixel, and make the
pointer stay within the screen boundaries.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Touchpad and mouse in VM, use absolute coordinate, with EV_ABS.

Touchpad is a bit special because it's smaller than the screen, so
you need to slide multiple time to go from one edge to the other.

Handle double tap and triple tap as paste, to make it easy to copy/
paste with a touchpad.

This is very basic, and doesn't include all the quirks from libinput,
but I hope it works in most cases.

Touchscreen may work, but I don't feel it's needed to support it in
kmscon, as you will need gesture/onscreen keyboard to make it useful.
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Mouse support is still experimental, so it's disabled by default.
Also update the man page accordingly
As the mouse pointer is not really transparent, it's better to hide
it when it's not in use.
Select a word by double left click on it.
It requires libtsm >= 4.3.0 to call tsm_screen_selection_word()
Only handle double click for mouse left button as a first
implementation

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Handle the case where the screen is not used, and its width and
height are set to 0.

Suggested-by: Geo Carncross <geocar@gmail.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
@kdj0c kdj0c merged commit 656ff1b into Aetf:main Nov 24, 2025
1 check passed
@kdj0c kdj0c deleted the pointer_support branch December 5, 2025 10:13
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.

Mouse support?

2 participants