unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Brian Cully <bjc@spork.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca,
	rms@gnu.org
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 22:21:49 -0400	[thread overview]
Message-ID: <87k0bwe45v.fsf@ditto.jhoto.spork.org> (raw)
In-Reply-To: <87pmlo5qgr.fsf@yahoo.com>


Po Lu <luangruo@yahoo.com> writes:

> libinput is libinput.  It is a driver for the X server, but it is
> otherwise completely unrelated to the X input extension, which can only
> operate correctly if each name uniquely identifies a device.

	I think I must be misunderstanding something, because I have
devices that are identically named within X and also operate
correctly. That seems to me to run counter to “can only operate
correctly if each name uniquely identifies a device”.

	I bring up USB because libinput has to get its information from
somewhere, and in the cases of the devices I have that libinput
publishes, that is USB. I could potentially dig out some bluetooth ones,
but that seems uneccesary.

> libinput is the device driver being used, yes.

	I am at a loss, then. I do not know why libinput would choose to
give your devices unique names but not mine. Does the “Device” line of
‘libinput list-devices’ also show unique names?

> Then either the names are different, or the devices behave identically
> in every way, and nobody has yet had a reason to treat the devices
> differently.  If the second "Valve Software Steam Controller" was a foot
> pedal, I'm certain it would not be working correctly in software
> designed for that foot pedal.

	This thread began with a claim that devices were uniquely named,
and thus could be disambiguated within Emacs to provide different
functionality based on their names. If I wanted to treat the pointer on
one Steam Controller as a vertical scroll, and on the other a horizontal
scroll, I do not currently see how I could do that.

> Anyway, that "they work fine in X" proves this is not a problem in
> practice, so we will wait until someone actually complains in real word
> usage.

	What this shows to me is that precious little in the X stack
actually cares about device names. For the most part, they are
irrelevant, as devices are self-describing in terms of capabilities.

	That it is useful for a user to modify the way a device behaves
in the context of Emacs I take at face value, and I also grant that the
name is one possible, though hopefully as is clear by now, not
fool-proof way to do that.

	I do not actually believe this to be a huge problem. Outside of
hardware hackers I don’t think I know anyone who attaches two identical
devices. Maybe musicians? I’m sure they exist, but it’s not a lot of
people. But I also don’t believe this is a problem Emacs can solve using
only the device name, for reasons already stated.

> Did you try asking for the device name using the xinput tool?  What does
> it say?

	I’m not very familiar with that tool, but here is the relevant
output of ‘xinput list’:
---[snip]---
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Valve Software Steam Controller         	id=9	[slave  pointer  (2)]
⎜   ↳ Valve Software Steam Controller         	id=10	[slave  pointer  (2)]
	⋮
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
	⋮
    ↳ Valve Software Steam Controller         	id=24	[slave  keyboard (3)]
    ↳ Valve Software Steam Controller         	id=25	[slave  keyboard (3)]
---[snip]---

> Also, what happens if you run `xinput list-props "Valve Software Steam
> Controller"'?  Can you show the output?

	Gladly (sorry about the length, but I’m not sure what
information you might be looking for):
---[snip]---
$ xinput list-props 'Valve Software Steam Controller'
Warning: There are multiple devices matching 'Valve Software Steam Controller'.
To ensure the correct one is selected, please use the device ID, or prefix the
device name with 'pointer:' or 'keyboard:' as appropriate.

unable to find device Valve Software Steam Controller
$ xinput list-props 24
Device 'Valve Software Steam Controller':
	Device Enabled (154):	1
	Coordinate Transformation Matrix (156):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Send Events Modes Available (275):	1, 0
	libinput Send Events Mode Enabled (276):	0, 0
	libinput Send Events Mode Enabled Default (277):	0, 0
	Device Node (278):	"/dev/input/event30"
	Device Product ID (279):	10462, 4418
$ xinput list-props 25
Device 'Valve Software Steam Controller':
	Device Enabled (154):	1
	Coordinate Transformation Matrix (156):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Send Events Modes Available (275):	1, 0
	libinput Send Events Mode Enabled (276):	0, 0
	libinput Send Events Mode Enabled Default (277):	0, 0
	Device Node (278):	"/dev/input/event29"
	Device Product ID (279):	10462, 4418
$ xinput list-props 9
Device 'Valve Software Steam Controller':
	Device Enabled (154):	1
	Coordinate Transformation Matrix (156):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (290):	0
	libinput Natural Scrolling Enabled Default (291):	0
	libinput Scroll Methods Available (292):	0, 0, 1
	libinput Scroll Method Enabled (293):	0, 0, 0
	libinput Scroll Method Enabled Default (294):	0, 0, 0
	libinput Button Scrolling Button (295):	2
	libinput Button Scrolling Button Default (296):	2
	libinput Button Scrolling Button Lock Enabled (297):	0
	libinput Button Scrolling Button Lock Enabled Default (298):	0
	libinput Middle Emulation Enabled (299):	0
	libinput Middle Emulation Enabled Default (300):	0
	libinput Accel Speed (301):	-0.200000
	libinput Accel Speed Default (302):	0.000000
	libinput Accel Profiles Available (303):	1, 1
	libinput Accel Profile Enabled (304):	0, 1
	libinput Accel Profile Enabled Default (305):	1, 0
	libinput Left Handed Enabled (306):	0
	libinput Left Handed Enabled Default (307):	0
	libinput Send Events Modes Available (275):	1, 0
	libinput Send Events Mode Enabled (276):	0, 0
	libinput Send Events Mode Enabled Default (277):	0, 0
	Device Node (278):	"/dev/input/event30"
	Device Product ID (279):	10462, 4418
	libinput Drag Lock Buttons (308):	<no items>
	libinput Horizontal Scroll Enabled (309):	1
	libinput Scrolling Pixel Distance (310):	15
	libinput Scrolling Pixel Distance Default (311):	15
	libinput High Resolution Wheel Scroll Enabled (312):	1
$ xinput list-props 10
Device 'Valve Software Steam Controller':
	Device Enabled (154):	1
	Coordinate Transformation Matrix (156):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (290):	0
	libinput Natural Scrolling Enabled Default (291):	0
	libinput Scroll Methods Available (292):	0, 0, 1
	libinput Scroll Method Enabled (293):	0, 0, 0
	libinput Scroll Method Enabled Default (294):	0, 0, 0
	libinput Button Scrolling Button (295):	2
	libinput Button Scrolling Button Default (296):	2
	libinput Button Scrolling Button Lock Enabled (297):	0
	libinput Button Scrolling Button Lock Enabled Default (298):	0
	libinput Middle Emulation Enabled (299):	0
	libinput Middle Emulation Enabled Default (300):	0
	libinput Accel Speed (301):	-0.200000
	libinput Accel Speed Default (302):	0.000000
	libinput Accel Profiles Available (303):	1, 1
	libinput Accel Profile Enabled (304):	0, 1
	libinput Accel Profile Enabled Default (305):	1, 0
	libinput Left Handed Enabled (306):	0
	libinput Left Handed Enabled Default (307):	0
	libinput Send Events Modes Available (275):	1, 0
	libinput Send Events Mode Enabled (276):	0, 0
	libinput Send Events Mode Enabled Default (277):	0, 0
	Device Node (278):	"/dev/input/event29"
	Device Product ID (279):	10462, 4418
	libinput Drag Lock Buttons (308):	<no items>
	libinput Horizontal Scroll Enabled (309):	1
	libinput Scrolling Pixel Distance (310):	15
	libinput Scrolling Pixel Distance Default (311):	15
	libinput High Resolution Wheel Scroll Enabled (312):	1
---[snip]---

-bjc



  parent reply	other threads:[~2022-04-11  2:21 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org>
     [not found] ` <20220407133623.9C209C009A8@vcs2.savannah.gnu.org>
2022-04-07 14:05   ` master 3b41141708: Expose the name of an event's input device to Lisp Stefan Monnier
2022-04-07 23:31     ` Po Lu
2022-04-07 23:41       ` Stefan Monnier
2022-04-08  0:07         ` Po Lu
2022-04-08  6:02         ` Eli Zaretskii
2022-04-08  6:08           ` Po Lu
2022-04-08  6:26             ` Eli Zaretskii
2022-04-08  7:36               ` Po Lu
2022-04-08 11:12                 ` Eli Zaretskii
2022-04-08 11:31                   ` Po Lu
2022-04-08 12:12                     ` Eli Zaretskii
2022-04-08 12:35                       ` Po Lu
2022-04-09  6:48                         ` Eli Zaretskii
2022-04-09  9:06                           ` Po Lu
2022-04-09  9:09                             ` Lars Ingebrigtsen
2022-04-09  9:30                             ` Eli Zaretskii
2022-04-09 10:03                               ` Po Lu
2022-04-09 11:03                                 ` Eli Zaretskii
2022-04-09 11:44                                   ` Po Lu
2022-04-09 14:04                                     ` Eli Zaretskii
2022-04-09 16:33                                       ` Stefan Monnier
2022-04-09 16:41                                         ` Lars Ingebrigtsen
2022-04-09 17:06                                           ` Eli Zaretskii
2022-04-09 17:16                                             ` Eli Zaretskii
2022-04-09 17:52                                             ` Brian Cully
2022-04-09 19:18                                               ` Eli Zaretskii
2022-04-10  0:54                                               ` Po Lu
2022-04-10  1:46                                                 ` Brian Cully
2022-04-10  2:11                                                   ` Po Lu
2022-04-10  2:45                                                     ` Brian Cully
2022-04-10  3:30                                                       ` Po Lu
2022-04-10  0:37                                           ` Po Lu
2022-04-10  5:49                                             ` Eli Zaretskii
2022-04-10  6:09                                               ` Po Lu
2022-04-10  6:44                                                 ` Eli Zaretskii
2022-04-10  7:31                                                   ` Po Lu
2022-04-10  8:28                                                     ` Eli Zaretskii
2022-04-10  8:50                                                       ` Po Lu
2022-04-10  9:17                                                         ` Eli Zaretskii
2022-04-10  9:25                                                           ` Po Lu
2022-04-10 11:15                                                             ` Po Lu
2022-04-10 15:16                                                               ` Stefan Monnier
2022-04-11  1:02                                                                 ` Po Lu
2022-04-10 11:46                                                   ` Lars Ingebrigtsen
2022-04-10 11:41                                             ` Lars Ingebrigtsen
2022-04-10  0:48                                       ` Po Lu
2022-04-10  6:04                                         ` Eli Zaretskii
2022-04-10  6:17                                           ` Po Lu
2022-04-10  6:49                                             ` Eli Zaretskii
2022-04-10  7:01                                               ` Po Lu
2022-04-10  8:24                                                 ` Eli Zaretskii
2022-04-10  8:42                                                   ` Po Lu
2022-04-10  9:13                                                     ` Eli Zaretskii
2022-04-10 12:51                                                       ` Brian Cully
2022-04-10 13:21                                                         ` Po Lu
2022-04-10 18:08                                                           ` Brian Cully
2022-04-11  0:58                                                             ` Po Lu
2022-04-11  1:08                                                               ` Brian Cully
2022-04-11  2:00                                                                 ` Po Lu
2022-04-11  2:03                                                                   ` Po Lu
2022-04-11  2:21                                                                   ` Brian Cully [this message]
2022-04-11  3:12                                                                     ` Po Lu
2022-04-11  4:11                                                                       ` Brian Cully
2022-04-11  5:20                                                                         ` Po Lu
2022-04-11 11:33                                                                           ` Brian Cully
2022-04-11 14:09                                                                             ` Po Lu
2022-04-11 16:26                                                                               ` Brian Cully
2022-04-11 10:10                                                             ` Lars Ingebrigtsen
2022-04-10 12:44                                                     ` Brian Cully
2022-04-10 13:14                                                       ` Po Lu
2022-04-08 14:27         ` Stefan Monnier
2022-04-09  0:24           ` Po Lu
2022-04-09  2:52             ` Stefan Monnier
2022-04-09  3:17               ` Po Lu
2022-04-09 13:31                 ` Stefan Monnier
2022-04-09 13:37                   ` Po Lu
2022-04-09 14:20                     ` Stefan Monnier
2022-04-10  0:58                       ` Po Lu
2022-04-09 14:31                     ` Eli Zaretskii
2022-04-10  0:56                       ` Po Lu
2022-04-10  6:11                         ` Eli Zaretskii
2022-04-10  6:23                           ` Po Lu
2022-04-10  6:52                             ` Eli Zaretskii
2022-04-10  7:37                               ` Po Lu
2022-04-10  8:12                                 ` Eli Zaretskii
2022-04-09  6:22             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0bwe45v.fsf@ditto.jhoto.spork.org \
    --to=bjc@spork.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).