From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Cully Newsgroups: gmane.emacs.devel Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp Date: Sun, 10 Apr 2022 22:21:49 -0400 Message-ID: <87k0bwe45v.fsf@ditto.jhoto.spork.org> References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <8735impqw4.fsf@yahoo.com> <83v8vi8uyu.fsf@gnu.org> <871qy6o9p3.fsf@yahoo.com> <83o81a8qnd.fsf@gnu.org> <87zgkulbuu.fsf@yahoo.com> <83ilri8iag.fsf@gnu.org> <87tub1kbkf.fsf@yahoo.com> <831qy58ofh.fsf@gnu.org> <87sfqlfomt.fsf@yahoo.com> <83wnfx77s0.fsf@gnu.org> <87o819e80r.fsf@yahoo.com> <83sfql73di.fsf@gnu.org> <87ee25cosj.fsf@yahoo.com> <83mtgt712o.fsf@gnu.org> <87r1659jey.fsf@ditto.jhoto.spork.org> <87v8vh845k.fsf@yahoo.com> <87mtgsyeg0.fsf@ditto.jhoto.spork.org> <87v8vg77vx.fsf@yahoo.com> <87ee24xuv6.fsf@ditto.jhoto.spork.org> <87pmlo5qgr.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32964"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 29.0.50 Cc: Eli Zaretskii , emacs-devel@gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca, rms@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 11 04:39:15 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndjxS-0008K4-PQ for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Apr 2022 04:39:15 +0200 Original-Received: from localhost ([::1]:56430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndjxR-0007Y8-76 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 22:39:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndjwg-0006rj-QM for emacs-devel@gnu.org; Sun, 10 Apr 2022 22:38:26 -0400 Original-Received: from coleridge.kublai.com ([166.84.7.167]:53300 helo=mail.spork.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndjwe-0002Zr-T2; Sun, 10 Apr 2022 22:38:26 -0400 Original-Received: from ditto (unknown [IPv6:2001:470:1f07:1b9:8650:a942:ec5e:856b]) by mail.spork.org (Postfix) with ESMTPSA id B3E0C34DC; Sun, 10 Apr 2022 22:37:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1649644696; bh=7qvBepUIvFESY6O14CDAYcWOBV35qWrYyGJOLRh9bDU=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=c6RH2Ts/CaBReC0e5Qizwdvyshp4751mTzwfIjyH0F1swYXIYismmfa7MAfJIR9xb EwQ0NrMYHgHk02FCWq07EhZuEigDKzsXlrC3SAfNCnodsf69SReQp+v7lGkC8Dr3ox +8egTgtzwB1tFkWlreiUGuEtNyOwAn0WOtD1eCW8= In-reply-to: <87pmlo5qgr.fsf@yahoo.com> Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@spork.org; helo=mail.spork.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288167 Archived-At: Po Lu 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 =E2=80=9Ccan only operate correctly if each name uniquely identifies a device=E2=80=9D. 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 =E2=80=9CDevice=E2=80= =9D line of =E2=80=98libinput list-devices=E2=80=99 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=E2=80=99t think I know anyone who attaches two ident= ical devices. Maybe musicians? I=E2=80=99m sure they exist, but it=E2=80=99s not= a lot of people. But I also don=E2=80=99t 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=E2=80=99m not very familiar with that tool, but here is the relevant output of =E2=80=98xinput list=E2=80=99: ---[snip]--- =E2=8E=A1 Virtual core pointer id=3D2 [master pointer = (3)] =E2=8E=9C =E2=86=B3 Virtual core XTEST pointer id=3D4 [slav= e pointer (2)] =E2=8E=9C =E2=86=B3 Valve Software Steam Controller id=3D9 [slav= e pointer (2)] =E2=8E=9C =E2=86=B3 Valve Software Steam Controller id=3D10 [sla= ve pointer (2)] =E2=8B=AE =E2=8E=A3 Virtual core keyboard id=3D3 [master keyboard = (2)] =E2=8B=AE =E2=86=B3 Valve Software Steam Controller id=3D24 [slave keyb= oard (3)] =E2=86=B3 Valve Software Steam Controller id=3D25 [slave keyb= oard (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=E2=80=99m 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 Controll= er'. 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.00= 0000, 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.00= 0000, 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.00= 0000, 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): 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.00= 0000, 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): 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