Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
using 2 independent mice at the same time?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Spanik
Veteran
Veteran


Joined: 12 Dec 2003
Posts: 1012
Location: Belgium

PostPosted: Sat Jan 18, 2025 11:58 am    Post subject: using 2 independent mice at the same time? Reply with quote

Is it possible to use 2 mice at the same in a way they have 2 pointers? Strange question perhaps but I'd like to try this as I think it could be handy when working with 2 screens. Like when you have on one screen a drawing where you need to take measurements in app A and then on the other screen another app B where you are using those measurements. I'm drawing a 3D model from old scanned plans and this would avoid a lot of moving around with the mouse. Certainly with large screens.

I just tried to connect 2 mice but they both control the same pointer. So that doesn't help.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 324
Location: Somewhere in the 77

PostPosted: Mon Jan 20, 2025 10:56 am    Post subject: Reply with quote

Hello,

I do not think that is possible, never heard of multiple mouse pointer, Linux, Windows, Mac or other.

You'll have probably to work around that, depending on your desktop environment, maybe there would be a cool feature doing the «teleportation» of your mouse icon in the middle of another window while hiting some shortcut.

Beside that, I do not see how that would be possible.

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
Gatsby
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2010
Posts: 124
Location: 127.0.0.1

PostPosted: Mon Jan 20, 2025 1:24 pm    Post subject: Reply with quote

Spanik, here you go:

Code:
emerge --oneshot x11-apps/xinput


https://stackoverflow.com/questions/4012352/linux-dual-mice-multiple-mice-with-multiple-mouse-pointers


Look at answer 27 (the part with xinput).


Regards,

Gatsby
_________________
"Its your Gentoo, your way. When it breaks, you can keep all the pieces."
-- NeddySeagoon@forums.gentoo.org
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2653

PostPosted: Tue Jan 21, 2025 10:24 am    Post subject: Reply with quote

Nearly 20 years ago, after Xorg branched off of XFree86, there was an experimental Xorg module for having multiple independent pointers on screen. Maybe it vanished from the Internet or I just can't remember enough to find it, but I found this:

https://wiki.archlinux.org/title/Multi-pointer_X

and this:

https://ao2.it/en/blog/2010/01/19/poor-mans-multi-touch-using-multiple-mice-xorg

There was a demonstration how two people play tic-tac-toe using two different mice with independent pointers.

Best Regards,
Georgi
Back to top
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 324
Location: Somewhere in the 77

PostPosted: Tue Jan 21, 2025 12:21 pm    Post subject: Reply with quote

My bad then, happy to learn each day, this seems possible :).

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
Spanik
Veteran
Veteran


Joined: 12 Dec 2003
Posts: 1012
Location: Belgium

PostPosted: Wed Jan 22, 2025 5:24 pm    Post subject: Reply with quote

logrusx wrote:
Nearly 20 years ago, after Xorg branched off of XFree86, there was an experimental Xorg module for having multiple independent pointers on screen. Maybe it vanished from the Internet or I just can't remember enough to find it, but I found this:

https://wiki.archlinux.org/title/Multi-pointer_X

and this:

https://ao2.it/en/blog/2010/01/19/poor-mans-multi-touch-using-multiple-mice-xorg

There was a demonstration how two people play tic-tac-toe using two different mice with independent pointers.

Best Regards,
Georgi


Nice! I know what to do this weekend :) I'll let you know where this ends.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
Veteran
Veteran


Joined: 12 Dec 2003
Posts: 1012
Location: Belgium

PostPosted: Sun Jan 26, 2025 10:36 am    Post subject: Reply with quote

Gatsby wrote:
Spanik, here you go:

Code:
emerge --oneshot x11-apps/xinput


https://stackoverflow.com/questions/4012352/linux-dual-mice-multiple-mice-with-multiple-mouse-pointers


Look at answer 27 (the part with xinput).


Regards,

Gatsby


Tried it and got strange results. Just a recap of what I did.

1: xinput with just my keyboard and mouse I always use:
Code:
~ $ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ HID 04b4:0033                             id=9    [slave  pointer  (2)]
⎜   ↳ HID 0557:2419                             id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. HP Basic USB Keyboard    id=8    [slave  keyboard (3)]
    ↳ HID 0557:2419


2: made the new master
Code:
~ $ xinput create-master "usb_mouse"
~ $ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ HID 04b4:0033                             id=9    [slave  pointer  (2)]
⎜   ↳ HID 0557:2419                             id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. HP Basic USB Keyboard    id=8    [slave  keyboard (3)]
    ↳ HID 0557:2419                             id=10   [slave  keyboard (3)]
⎡ usb_mouse pointer                             id=12   [master pointer  (13)]
⎜   ↳ usb_mouse XTEST pointer                   id=14   [slave  pointer  (12)]
⎣ usb_mouse keyboard                            id=13   [master keyboard (12)]
    ↳ usb_mouse XTEST keyboard                  id=15   [slave  keyboard (13)]


At this point I get another mouse pointer and text cursor in the middle of the screen. They flicker a bit when I move the (original) mouse.

3: I plug in a Logitech USB mouse. I now can move the mouse pointer with both mice, the first (cabled) and the second one (USB wireless)

4: xinput again to check on the ID's
Code:
xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ HID 04b4:0033                             id=9    [slave  pointer  (2)]
⎜   ↳ HID 0557:2419                             id=11   [slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver Mouse               id=18   [slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver Consumer Control    id=19   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. HP Basic USB Keyboard    id=8    [slave  keyboard (3)]
    ↳ HID 0557:2419                             id=10   [slave  keyboard (3)]
    ↳ Logitech USB Receiver System Control      id=16   [slave  keyboard (3)]
    ↳ Logitech USB Receiver                     id=17   [slave  keyboard (3)]
    ↳ Logitech USB Receiver Consumer Control    id=20   [slave  keyboard (3)]
⎡ usb_mouse pointer                             id=12   [master pointer  (13)]
⎜   ↳ usb_mouse XTEST pointer                   id=14   [slave  pointer  (12)]
⎣ usb_mouse keyboard                            id=13   [master keyboard (12)]
    ↳ usb_mouse XTEST keyboard                  id=15   [slave  keyboard (13)]


Now it looks as if the second USB mouse is attached to the master keyboard. And indeed I have strange things happening if I click with the first mouse to activate another window. Sometimes I loose the keyboard and have to click a bit with each mouse to get it active again.

The next step in the link is:
Code:
Now you just need to reattach one of your mice to the new master xinput reattach "mouse id" "new master id".


Do I get it right that I now need to attach "id=16" to "id=12"? I'm not sure and the rest of the explanation doesn't inspire confidence. The first time I did "xinput remove-master 12" X just crashed.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2653

PostPosted: Sun Jan 26, 2025 11:04 am    Post subject: Reply with quote

Spanik wrote:
Gatsby wrote:
Spanik, here you go:

Code:
emerge --oneshot x11-apps/xinput


https://stackoverflow.com/questions/4012352/linux-dual-mice-multiple-mice-with-multiple-mouse-pointers


Look at answer 27 (the part with xinput).


Regards,

Gatsby


Tried it and got strange results. Just a recap of what I did.


It seems to me that has never have been a real solution but a hack that relied on bugs, side effects or something not quite functioning as intended.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Gatsby
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2010
Posts: 124
Location: 127.0.0.1

PostPosted: Sun Jan 26, 2025 1:33 pm    Post subject: Reply with quote

Spanik wrote:


The next step in the link is:
Code:
Now you just need to reattach one of your mice to the new master xinput reattach "mouse id" "new master id".

Do I get it right that I now need to attach "id=16" to "id=12"? I'm not sure and the rest of the explanation doesn't inspire confidence. The first time I did "xinput remove-master 12" X just crashed.

Yes, it would be
Code:
xinput reattach <id of one of your mouse devices> 12


Unfortunately xinput seems to not to work so well with recent xorg-server versions, as removing the new master resulted in terminating X here as well.
_________________
"Its your Gentoo, your way. When it breaks, you can keep all the pieces."
-- NeddySeagoon@forums.gentoo.org
Back to top
View user's profile Send private message
Gatsby
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2010
Posts: 124
Location: 127.0.0.1

PostPosted: Sun Jan 26, 2025 1:38 pm    Post subject: Reply with quote

logrusx wrote:
It seems to me that has never have been a real solution but a hack that relied on bugs, side effects or something not quite functioning as intended.

It is basically the same as your proposal: https://wiki.archlinux.org/title/Multi-pointer_X
_________________
"Its your Gentoo, your way. When it breaks, you can keep all the pieces."
-- NeddySeagoon@forums.gentoo.org
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2653

PostPosted: Sun Jan 26, 2025 1:49 pm    Post subject: Reply with quote

Gatsby wrote:
logrusx wrote:
It seems to me that has never have been a real solution but a hack that relied on bugs, side effects or something not quite functioning as intended.

It is basically the same as your proposal: https://wiki.archlinux.org/title/Multi-pointer_X


My memory was something existed explicitly for that purpose. This is not my proposal but what I found trying to dig for that memory. After all it was nearly 20 years ago, I can't rely neither on my memory, not on the Internet. Back then I wasn't interested in such stuff and just noted the idea and the fact that implementation existed. I don't remember any details aside from the video where they demonstrated two players playing tic-tac-toe with two different pointers. And as I said in my original post, it was a module for Xorg, shortly after it got split from XFree86 and refactored to be modular. That's why I remember the time frame. The Internet on the other hand does not guarantee 20 y.o. stuff would still exist, neither it being easily found if it existed.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum