From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp Date: Fri, 08 Apr 2022 07:31:41 +0800 Message-ID: <87ee28xyg2.fsf@yahoo.com> References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <20220407133623.9C209C009A8@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14556"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 08 01:32: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 1ncbc9-0003OF-7a for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Apr 2022 01:32:33 +0200 Original-Received: from localhost ([::1]:58096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncbc7-0003Xc-L3 for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Apr 2022 19:32:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncbbW-0002sQ-EM for emacs-devel@gnu.org; Thu, 07 Apr 2022 19:31:54 -0400 Original-Received: from sonic302-22.consmr.mail.ne1.yahoo.com ([66.163.186.148]:46843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncbbU-0005tG-Pv for emacs-devel@gnu.org; Thu, 07 Apr 2022 19:31:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649374311; bh=FeXyviIxGiOXjXo0CsNadP2mTCpMBLyHnxTZoQzPqiM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=sI2LOx/1PW1OMpqGQsc/CAzE8yAtqXKdIl/eHXhTB8AKxMGdIGyotoysnMazKX33c546RfSUKkKnebiDbBgqseqpE7Xu+2Cx5+XB1qpaSxFb+7vHx/56Y5QgsMuAyKtKF1i3m18gW9NuxE6VvCfFfFBjQZEDIIbttGCoT7h+AMKlgJGh9iFMl5yRJK1y6ZcC3G0aOYaSTGJqDnV+Mwd8YvGdJ1GrFkbBPgCFnfeCfZ9fNsION0DRG61Hi5F/kbxXqN/uj5hd2mgEaKM4+inSCh3KSKwRkAZkTwyx057jixDw+3Ds37iwZmUpOG7ckrjHZdRxdlBmpiglkysvVkBYzg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649374311; bh=2Ju0ig7tLCbyKZJ71ap2bgQGs4GWi4MxEvUlBeJGoOY=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=dnY1jsJ6YjdbhTWW5IFMKRx9tS4jrZrFu9oPuSSbatKBSsVcH4Ks4awp3z6JiusCD8cDwYXJk0MIrwosrUu9C4/RRtd1cmrCc7xecA8mQ6hqNGPJkzyN+YbOsuWDnG4rn+s305CEUU34VMSPe7U0dFKU8tfSs4P7aqae47bkcoT7L4PKdBayZKN5PdvLK/rXJgx2igV59ipD3iMopRPmr99p7chm0Wbozb4wqf7kT3MBvcHVpFvpYtSpOp9kxXXFpZzj5ZHRnTnpb5Y5OCRhoZNL4Mu8nU7sPzehiPsJkfl1VNeXb9j+hEqlsK8vndiTEJP6CnWhpI0sUjFpvCQp+w== X-YMail-OSG: aXEESX0VM1lL4EWuF8o7eQL8wGaL1EQ9.5.sRJ8_3Q3D3b0zEy9SIeUAJR7Fs6v nbFTLHz_PR4IQlOlhj3xuIOw3PCFh9_k9zrPguPoqhuZZFU0aI1qRZzv1FqQg0y94v_Cp5_TLrax T.7VASCun6eHZGS.LMBg.zgYlaNy5NO03qfJEaW4GNvsUEZKH89kXas0sCDd8OxfkXkK.2_tR0gk K0QJCqFHwRkd9flgsOnDpEDenB4wN1iU0Yvjc.5B6e52IrkPa62cMd2dN4vjjpkRRGuwHGyv0VKV CsEi_jJlCgaAwIPqy0MAnuEph6rOBF2kEWHI5zPOHA7rDfUPs8utVlaq5OL9zT2KN4.Kecg4xd8w ZCsJBXTQg6zeN.N2YXAoFkrdojco8GCz6VGtrP1GXThcD4J7xlE1SEBSry2UzYbpZxvQ5e_N7dtF MbRq_Rvtz3AkgVQW0_MKRqYh6SOE8VntlpqfBx7xNsINJMCm.B7d0ED4khabirwaPLT..JkazGz. fg.y6g4mrG3EUxMUJ.WZl7XkppTOvMLPYHBHbXXAG6wbxyrxtEU9b2EKqKgaMJ12rtNRXGRTVEyg 7HVCkCRcsIzOpH6voDJX.aroNj9WH1Pd8teDWIHUlEZwVAFSP6Aw7IFBw3a_CwLVvqDYatejfU90 JuPtckFd83Ee2RFNGQhlunOCSwr7vLzva1vvgNXnrGexF6ut0fYs.5v8.pATWoDvO0B1vAhgMq5n qH4kJh_MFx9.ZXExNgsGeJW49cu1xpFqk0OmfLJjG8WrMSgFzpqJOMjNVj33zIcorLL4zlvuTxe. NXwzpLsePMMNZAQpuWTNQunNQsXsSNkXwOUTwWORxs X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Thu, 7 Apr 2022 23:31:51 +0000 Original-Received: by hermes--canary-production-sg3-65d7bd97b5-gqv44 (VZM Hermes SMTP Server) with ESMTPA ID 028991dc694cdfdf38f29aabd3800680; Thu, 07 Apr 2022 23:31:45 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Thu, 07 Apr 2022 10:05:50 -0400") X-Mailer: WebService/1.1.20048 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.148; envelope-from=luangruo@yahoo.com; helo=sonic302-22.consmr.mail.ne1.yahoo.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:287908 Archived-At: Stefan Monnier writes: >> +@defvar last-event-device >> +This variable records the name of the input device from which the last >> +input event read was generated. It is @code{nil} if no such device >> +exists, i.e., the last input event was read from >> +@code{unread-command-events}, or it came from a keyboard macro. >> + >> +When the X Input Extension is being used on X Windows, the device name >> +is a string that is unique to each physical keyboard, pointing device >> +and touchscreen attached to the X server. Otherwise, it is either the >> +string @samp{"Virtual core pointer"} or @samp{"Virtual core >> +keyboard"}, depending on whether the event was generated by a pointing >> +device (such as a mouse) or a keyboard. >> +@end defvar > > Any chance we could attach this info to the events rather than storing > them in some global var making it unclear to which event it applies? We can't put it in the event list, i.e. key events are mostly just characters, and can't be extended. Which event the global variable applies to is also perfectly clear: it applies to the last event that was read, either by the command loop or read-event.