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 08:49:07 +0300 Message-ID: <8335il8p4c.fsf@gnu.org> References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <87ee28xyg2.fsf@yahoo.com> <83ee28az95.fsf@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> <87k0by43an.fsf@gnus.org> <87bkx9lqno.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5814"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.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 Sun Apr 10 07:51:07 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 1ndQTa-0001KV-Tb for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 07:51:07 +0200 Original-Received: from localhost ([::1]:37626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndQTZ-0000gj-JX for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 01:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndQRn-0008Ok-VG for emacs-devel@gnu.org; Sun, 10 Apr 2022 01:49:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndQRn-0001l5-GU; Sun, 10 Apr 2022 01:49:15 -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=ysU4pOOJVEnYNqtYdrhabnm1Zs65qB4lLCgjC4EVuV4=; b=mlEWi5MnnzTD qoN2azEu+Adx5ydCoeOQEoROc7H7HrrmlCiNBGc+Yi2qakeNUYCOfoe2UxnGDoo+XLKRS/ADGnXJB Eq5CSxti8ztQv5m4I14DNY5j8yrY342vhEuJDzW9I8M0lYNsF4SWaO2rpiYzHn1+ljwcpng6zGyZZ wCz9rG0Yu97gf/y+Y/+tCCwsWKzYykJXWT356qrYUVyqsaf8NElMwDbByEzwKMdoU8yU5xD+c4AcU m4Gh/5yCvFENFg8BPrGU9+q9eSRF7s/WbvA1Oeh2GznpIGnFtZaEx8Dlcp/Qk4GdJW9SgBCaB4ECb g3Mro8565vnL1aKWA7VjDQ==; Original-Received: from [87.69.77.57] (port=3368 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 1ndQRi-0006ot-8w; Sun, 10 Apr 2022 01:49:10 -0400 In-Reply-To: <87bkx9lqno.fsf@yahoo.com> (message from Po Lu on Sun, 10 Apr 2022 08:37:31 +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:288093 Archived-At: > From: Po Lu > Cc: Stefan Monnier , Eli Zaretskii > , Richard Stallman , emacs-devel@gnu.org > Date: Sun, 10 Apr 2022 08:37:31 +0800 > > Lars Ingebrigtsen writes: > > > So if I could somehow say > > > > (keymap-set global-mode-map "[device footpad]-b" 'do-something) > > > > that would be ideal. > > Oh yes, that would be good as well. We could have the ability to bind > keys to individual devices. I think the usual Emacs abstraction centers on the events, not on devices that emitted them. So we should be able to have devices emit events regardless of the device type/nature/name, and then the usual Emacs machinery of binding commands to key sequence will do the rest, and will do it according to user expectations. > I could imagine a different API that didn't put the device name into the > name of the key The key doesn't have to be a device name, it should rather describe the general type of the event/functionality. For example, all the devices that have foot pedals could emit events that begin with the same pseudo-function key 'foot-pedal'. Even if the device is called something else, and even if the device is simulated by some software that takes input from the keyboard or the mouse. > And the "name of footpad" can reasonably be system dependent It shouldn't be. > since the user will be making such a customization Users cannot customize the low-level layers of event production in Emacs, that level must be coded by us. We shouldn't try aiming for this goal, because it is basically unattainable, certainly as long as we use the window-system messages as triggers for producing events eventually exposed to Lisp.