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: Sat, 09 Apr 2022 22:18:37 +0300 Message-ID: <834k3283qq.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> <838rse89vr.fsf@gnu.org> <87czhqb0l2.fsf@ditto.jhoto.spork.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15644"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, larsi@gnus.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca, rms@gnu.org To: Brian Cully Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 09 21:19:33 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 1ndGcO-0003sI-SL for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 21:19:32 +0200 Original-Received: from localhost ([::1]:60270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndGcN-0000Dm-E2 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 15:19:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndGba-0007yh-CR for emacs-devel@gnu.org; Sat, 09 Apr 2022 15:18:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndGbZ-0000O2-TF; Sat, 09 Apr 2022 15:18:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=F3VaIXs5PQX7QN37CxNZYXGXxwKXYu9ORW/kORaUTao=; b=iMaJf5s1QmP6irf5VHTf i5E6vvAVf462cICjA0R9GJ75R0Sy8pPicAni5pD5lh+sHFWuEedP4Hn+VrZMaNCs2hcFlRTfvsGmL PjowamPMznw30HMCy9kF0dsLkIxm+InMkvYYQ3saf+TbKchUz1uwy9kwiViFk33U9CDGuMbvFoiKN fkRMC7MaHFT8Im8qaHc3BbwCta3CxY5x7IQKpjea9tuWrUkpAUOPDeDFaUyes7h03qJPgQ4sDfVhi T+HjMPuVqnyrkasrELjbid5fmajqqHMJ/AMC73C/ouJDvtD69Bwt0uMrSeoDDoSSMFVDGWUn8SFzk 2YEuWz5//th/hw==; Original-Received: from [87.69.77.57] (port=4043 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 1ndGbY-0001LR-To; Sat, 09 Apr 2022 15:18:41 -0400 In-Reply-To: <87czhqb0l2.fsf@ditto.jhoto.spork.org> (message from Brian Cully on Sat, 09 Apr 2022 13:52:52 -0400) 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:288049 Archived-At: > From: Brian Cully > Cc: Lars Ingebrigtsen , luangruo@yahoo.com, > monnier@iro.umontreal.ca, rms@gnu.org, emacs-devel@gnu.org > Date: Sat, 09 Apr 2022 13:52:52 -0400 > > > I would hope that such an event could be called just 'footpad-b', so > > that any device capable of such events could be implemented as > > emitting it, regardless of the device name/type/etc. > > I may have missed this earlier in the thread, but where would > these mappings of device identifier (name, USB VID:PID, whatever) to > device classes come from? How would that work for devices that can be > made to look like a *lot* of different input types? The same way any other input event works: Emacs generates a Lisp form of each event in low-level C code. > I’ve got a Steam Controller I can set up as a joystick, keyboard > (HID report and boot protocols), relative and absolute mouse, all at the > same time, and I can swap its functions on the fly. I’ve got a mouse > that can send both “pixel” scroll events as well as normal line-based > ones depending on how it’s configured. I have a programmable keyboard > that I can make look like any USB device I want. > > Is Emacs going to be responsible for mapping thousands of device > identifiers to device classes (which may change at runtime?) I just > don’t understand what this looks like from a user’s perspective. When your device behaves like a joystick, it will emit events that joysticks produce, and Emacs will treat that as a joystick. If this still doesn't help, my suggestion is to follow the code that produces existing events in Emacs, for example mouse events.