From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp Date: Sun, 10 Apr 2022 12:13:51 +0300 Message-ID: <83mtgt712o.fsf@gnu.org> References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <87fsmow1hz.fsf@yahoo.com> <83a6cway59.fsf@gnu.org> <87tub4uivu.fsf@yahoo.com> <83y20fakwn.fsf@gnu.org> <87o81bu7zj.fsf@yahoo.com> <83v8vjai4s.fsf@gnu.org> <87bkxbsqfl.fsf@yahoo.com> <835yniah0u.fsf@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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, rms@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 10 11:16:50 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 1ndTgg-0003tg-AQ for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 11:16:50 +0200 Original-Received: from localhost ([::1]:55392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndTgf-0002EV-6D for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 05:16:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTdr-0000yp-OQ for emacs-devel@gnu.org; Sun, 10 Apr 2022 05:13:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTdq-0004iu-DV; Sun, 10 Apr 2022 05:13:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WKXVgdvn3/MixP1ZvDQhHph7WNOYO7NufrrFVyrgpqI=; b=T0yg0aODBT95 bNqkQKNYZ4DLBwQmc6olFiRFnj5gFmtO6y+pjIGUiZQtSPl2ea1d3cPO/Eetp16HdPXXrP3kEvBt8 JNyG8DD7tXx7NcUALqar6guASoqsQw4R3l9xzAkkwTuB0dk21JK+4vFl7q1wa7dBTY84sKjIvPhvN M+U6KZfFTDElSiKiYPnWW+4cxWLlfIPfqSw8DK+Re/Cwy3d8hMJ2rlyr4saw7erAlxSGjXroPW28g XjRC0WcAPliZqa+NaBPGpwj89Jik9Ywd9ovv9APDttmC8PqsGlxNjK6bUlmNwvNHzRpFuki3qhdHz 5WsVuSNgOcNm0Jr05dww3g==; Original-Received: from [87.69.77.57] (port=1796 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTdp-0007Gg-C2; Sun, 10 Apr 2022 05:13:53 -0400 In-Reply-To: <87ee25cosj.fsf@yahoo.com> (message from Po Lu on Sun, 10 Apr 2022 16:42:36 +0800) 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:288121 Archived-At: > From: Po Lu > Cc: larsi@gnus.org, emacs-devel@gnu.org, rms@gnu.org, > monnier@iro.umontreal.ca > Date: Sun, 10 Apr 2022 16:42:36 +0800 > > Eli Zaretskii writes: > > > Define "wrong order"? IOW, how and in which situations is the order > > important/significant, > > Because the user doesn't know what lispy button a given button on a > certain mouse corresponds to. `mouse-15', for example, could be the > first button of any mouse connected to the system, assuming each mouse > has 14 buttons. The user doesn't care about numbering, the user only cares that when he presses a button on a certain mouse, the command that gets invoked is the command bound to that button of that mouse. Are you saying that querying the system about the connected mice will enumerate them in random order every time the system is restarted? If the order is the same, then the first time a mouse is connected, the user will see the symbols of the buttons of that mouse, and can then do the customizations accordingly. (The same initial adjustment will have to happen with your device-name idea, because the user won't know the name until the mouse is connected and Emacs tells him what is the name of the mouse.) If the order of enumerating the devices is unpredictable each time the system starts, we could have some data structure that maps device IDs to symbols of events. Such a data structure should be designed to be as safe as possible, though, so users couldn't shoot themselves in the foot by making spelling mistakes there. > > This is orthogonal. Being able to show the user the details of > > connected input devices is unrelated to how the input events are > > processed. The information comes from the same source, of course, but > > the code which produces input events can (and IMO should) consult this > > information at a low enough level, so that interpreting the events in > > Lisp and binding them to commands should not need any device > > information to be known by the application code. The application code > > should only use the Lispy input event, and that event should already > > include all the information required for processing it. > > Those programs don't just show the details to the user, they expose > those details to application code, in the hopes that the application > code will allow the code to behave appropriately, and the user to > customise the behavior based on those details. The "show the details to the user" part came from your remark: > This information isn't also very low level anymore, when many other > programs are exposing the device information to their users and plugins. > [...] > The KDE paint program Krita apparently has the ability to configure > individual tablet devices to behave differently. The user is presented > the device name and a set of different behaviors for that device. But anyway, It is okay for Emacs code to use this information provided that we do it on a low enough level.