emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 3b41141708: Expose the name of an event's input device to Lis


From: Brian Cully
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 22:21:49 -0400
User-agent: mu4e 1.6.10; emacs 29.0.50

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]