From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Mon, 4 Nov 2024 00:44:17 +0100 Message-ID: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------wjyYh0mSkl4gmttU2Ch9skQ4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5469"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 04 00:45:13 2024 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 1t7kHQ-0001Ep-QT for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 00:45:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7kGi-00025W-UN; Sun, 03 Nov 2024 18:44:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7kGh-00025L-La for emacs-devel@gnu.org; Sun, 03 Nov 2024 18:44:27 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7kGe-000795-EH for emacs-devel@gnu.org; Sun, 03 Nov 2024 18:44:27 -0500 Original-Received: from [192.168.68.105] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id 49016800F6 for ; Sun, 3 Nov 2024 23:44:18 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.105] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325071 Archived-At: This is a multi-part message in MIME format. --------------wjyYh0mSkl4gmttU2Ch9skQ4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, This is my proposal as a draft patch. It allows to detect double (or triple) tap on shift, control, alt keys (left or right), and bind commands to those. Also can add Hyper modifier to next key. - The change in emacs core (keyboard.c) is to define a new event 'physical-key. That event is bound to 'ignore on special-event-map, so will not interfere with anything, unless rebound. - Then, particular term implementations add these events when needed. The patch includes that for X, PGTK and ms-windows. Only rshift, lshift, lctrl, etc. generate events. We could add a variable to completely disable this if required. - Finally, the function physkey-init in physkey.el rebinds the event to physkey-handle. Bindings for n-tap of the keys can be added with physkey-bind. One can bind functions, commands, or the 'hyper symbol to add hyper modifier to the next key. I made a bad choice by using the word 'physical'. This is using key identification provided by the OS input system, so no scan codes or raw data. I also think it is unobstrusive to those who don't want this. And some related use cases that may be interesting, or not. - Cycling over something with a key like C-tab, and only really selecting when releasing C, like the window cycling with Alt+Tab, which cycles trough thumbnails until your release Alt, and lets you cancel by pressing Esc. - Better support for key-chords, https://github.com/emacsorphanage/key-chord - MacOS style holding key to get accented version of character. - Stenography input with standard keyboards. - Feature request: Add support for key release event https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22163 --------------wjyYh0mSkl4gmttU2Ch9skQ4 Content-Type: text/plain; charset=UTF-8; name="0001-Add-events-for-key-press-and-key-release-on-gui-syst.patch" Content-Disposition: attachment; filename*0="0001-Add-events-for-key-press-and-key-release-on-gui-syst.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBmYmQ5YjFkYTgyMTYzNGYwMjg4MzI3Yzg5MjRiZWM5ZmQ5OTYwYWEwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBDZWNpbGlvIFBhcmRvIDxjcGFyZG9AaW1heWhlbS5j b20+CkRhdGU6IE1vbiwgMjggT2N0IDIwMjQgMjM6NTc6MzUgKzAxMDAKU3ViamVjdDogW1BB VENIXSBBZGQgZXZlbnRzIGZvciBrZXkgcHJlc3MgYW5kIGtleSByZWxlYXNlIG9uIGd1aSBz eXN0ZW1zLgoKQW5kIGRldGVjdGlvbiBvZiBkb3VibGUvdHJpcGxlIHRhcHMgb24gbW9kaWZp ZXIga2V5cy4KLS0tCiBsaXNwL3BoeXNrZXkuZWwgfCA4MyArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiBzcmMva2V5Ym9hcmQuYyAgfCAyMSAr KysrKysrKysrKysrCiBzcmMvcGd0a3Rlcm0uYyAgfCAzNCArKysrKysrKysrKysrKysrKysr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VtYmVyIGtleSBwaHlza2V5LXRhcC1rZXlzKSkKKyAgICAgICAgOzsgS2V5IG5v dCBpbiB0YXAgbGlzdCwgY2xlYXIgaGlzdG9yeQorICAgICAgICAoc2V0cSBwaHlza2V5LWV2 ZW50cyBuaWwpCisgICAgICA7OyBDbGVhciBpdCBhbHNvIGlmIHRoZSBmaXJzdCBlbGVtZW50 IGlzIGZyb20gYSBkaWZmZXJlbnQga2V5CisgICAgICAoYW5kIHBoeXNrZXktZXZlbnRzCisg ICAgICAgICAgIChub3QgKGVxdWFsIChjbC10aGlyZCAoY2FyIHBoeXNrZXktZXZlbnRzKSkg a2V5KSkKKyAgICAgICAgICAgKHNldHEgcGh5c2tleS1ldmVudHMgbmlsKSkKKyAgICAgIChw dXNoIGxhc3QtaW5wdXQtZXZlbnQgcGh5c2tleS1ldmVudHMpCisgICAgICA7OyBPbmx5IGNh cmUgYWJvdXQgbGFzdCAyeE4gZXZlbnRzCisgICAgICAobnRha2UgKCogMiBuKSBwaHlza2V5 LWV2ZW50cykKKyAgICAgIDs7IElmIHdlIGhhdmU6CisgICAgICA7OyAtIEV4YWN0bHkgMiAq IG4gZXZlbnRzLgorICAgICAgOzsgLSBkb3duLCB1cCwgZG93biwgdXAsIC4uLgorICAgICAg OzsgLSBub3QgdHdvIG11Y2ggdGltZSBiZXR3ZWVuIGZpcnN0IGFuZCBsYXN0CisgICAgICAo YW5kIChlcSAoKiAyIG4pIChsZW5ndGggcGh5c2tleS1ldmVudHMpKQorICAgICAgICAgICAo Y2wtZXZlcnkgJ2VxCisgICAgICAgICAgICAgICAgICAgICAobnRha2UgKCogMiBuKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChsaXN0IG5pbCB0IG5pbCB0IG5pbCB0IG5pbCB0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmlsIHQgbmlsIHQgbmlsIHQg bmlsIHQpKQorICAgICAgICAgICAgICAgICAgICAgKG1hcGNhciAnY2wtc2Vjb25kIHBoeXNr ZXktZXZlbnRzKSkKKyAgICAgICAgICAgKDwgKC0gKGNsLWZvdXJ0aCAoY2wtZmlyc3QgcGh5 c2tleS1ldmVudHMpKQorICAgICAgICAgICAgICAgICAoY2wtZm91cnRoIChjYXIgKGxhc3Qg cGh5c2tleS1ldmVudHMpKSkpCisgICAgICAgICAgICAgIHRpbWVvdXQpCisgICAgICAgICAg IChwcm9nbgorICAgICAgICAgICAgIChzZXRxIHBoeXNrZXktZXZlbnRzIG5pbCkKKyAgICAg ICAgICAgICBrZXkpKSkpKQorCisoZGVmdW4gcGh5c2tleS1oYW5kbGUgKCkKKyAgKGludGVy YWN0aXZlKQorICAobGV0ICgodGFwLWtleSAocGh5c2tleS1kZXRlY3Qtbi10YXAKKyAgICAg ICAgICAgICAgICAgIHBoeXNrZXktdGFwLWNvdW50CisgICAgICAgICAgICAgICAgICBwaHlz a2V5LXRhcC10aW1lb3V0KSkpCisgICAgKHdoZW4gdGFwLWtleQorICAgICAgKGxldCAoKGZ1 bmMgKGNsLXRoaXJkCisgICAgICAgICAgICAgICAgICAgKHNlcS1maW5kCisgICAgICAgICAg ICAgICAgICAgIChsYW1iZGEgKGIpCisgICAgICAgICAgICAgICAgICAgICAgKGFuZCAoZXEg KGNsLWZpcnN0IGIpICd0YXApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXEgKGNs LXNlY29uZCBiKSB0YXAta2V5KSkpCisgICAgICAgICAgICAgICAgICAgIHBoeXNrZXktYmlu ZGluZ3MpKSkpCisgICAgICAgIChjb25kCisgICAgICAgICAoKGNvbW1hbmRwIGZ1bmMpIChj YWxsLWludGVyYWN0aXZlbHkgZnVuYykpCisgICAgICAgICAoKGZ1bmN0aW9ucCBmdW5jKSAo ZnVuY2FsbCBmdW5jKSkKKyAgICAgICAgICgoZXEgJ2h5cGVyIGZ1bmMpCisgICAgICAgICAg KG1lc3NhZ2UgIkgtLi4uIikKKyAgICAgICAgICAobGV0ICgociAocmVhZC1ldmVudCkpKQor ICA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Glz IGV2ZW50IGlzIGZvci4KICAgIEVWRU5UIGlzIHRoZSBYIGV2ZW50IHRvIGZpbHRlci4KQEAg LTE3ODU5LDYgKzE3ODk2LDggQEAgeF9maWx0ZXJfZXZlbnQgKHN0cnVjdCB4X2Rpc3BsYXlf aW5mbyAqZHB5aW5mbywgWEV2ZW50ICpldmVudCkKIAogICBzdHJ1Y3QgZnJhbWUgKmYxOwog CisgIHhfbWF5YmVfc2VuZF9waHlzaWNhbF9rZXlfZXZlbnQgKGRweWluZm8sIGV2ZW50KTsK KwogI2lmIGRlZmluZWQgSEFWRV9YSU5QVVQyICYmIGRlZmluZWQgVVNFX0dUSwogICBib29s IHhpbnB1dF9ldmVudCA9IGZhbHNlOwogICBpZiAoZHB5aW5mby0+c3VwcG9ydHNfeGkyCi0t IAoyLjM1LjEud2luZG93cy4yCgo= --------------wjyYh0mSkl4gmttU2Ch9skQ4--