unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Cecilio Pardo <cpardo@imayhem.com>
To: Po Lu <luangruo@yahoo.com>, Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Physical keyboard events
Date: Tue, 5 Nov 2024 08:15:27 +0100	[thread overview]
Message-ID: <7c1b4258-447f-433c-939e-21df7f9eeec3@imayhem.com> (raw)
In-Reply-To: <87wmhiihzx.fsf@yahoo.com>



On 05/11/2024 2:31, Po Lu wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>>> From: Po Lu <luangruo@yahoo.com>
>>> Cc: cpardo@imayhem.com,  emacs-devel@gnu.org
>>> Date: Mon, 04 Nov 2024 22:09:33 +0800
>>>
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>
>>>>> My point is that users frequently customize or exchange the positions of
>>>>> these modifier keys, and it is the resultant modifiers that they expect
>>>>> Emacs to report, not the keysyms, in special events or elsewhere.
>>>>
>>>> They should not expect that with these physical events, IMO.
>>>
>>> Why not?  If Caps Lock and Ctrl are exchanged, why should Emacs depart
>>> from every other program by not reporting Ctrl when the key labeled Caps
>>> Lock is depressed?
>>
>> On _physical_ level, there can be no "exchange of keys".  That
>> exchange exists on the logical level, where Ctrl followed by A yield a
>> single event whose value is 1, instead of 4 events (2 keypresses and 2
>> releases), none of which is 1.
> 
> No, that is configuring Caps Lock to serve as a Ctrl latch.  I'm
> speaking of remapping such a key to serve as _the_ Ctrl modifier, such
> that Caps_Lock+A yields an XK_Caps_Lock event that is discarded by Emacs
> as a modifier key, followed by a second event whose value is, yes, ^A,
> and with the Ctrl modifier bit set in its state.
> 
>>> Or, if another key than Hyper itself (which is not
>>> to be found on PC keyboards) is configured to serve as the Hyper
>>> modifier, surely we want it to be reported as Hyper?
>>
>> Again, not on this level.
>>
>>> The only reasonable manner of reporting these key events is reporting
>>> the modifiers that Emacs will generate in response to them.  The other
>>> correct approach, that of reporting X modifier bits uninterpreted,
>>> yields physical keys that are just as meaningless (ctrl, shift, mod1,
>>> mod2, mod3, and so forth) and with equally tenuous a relationship with
>>> the modifiers that users expect to receive from Emacs.
>>
>> They are presumably not meaningless to a Lisp program which wants to
>> receive such events.  Or at least this is my understanding.
> 
> I am interested to hear what use Lisp programs intend to make of a mod2,
> mod3, mod4, and mod5, whose meanings vary wildly from one machine to the
> next.  On my system, for example:
> 
> shift       Shift_L (0x32),  Shift_R (0x3e)
> lock        Caps_Lock (0x42)
> control     Control_L (0x25)
> mod1        Alt_L (0x40),  Alt_L (0xcc),  Meta_L (0xcd)
> mod2        Num_Lock (0x4d)
> mod3        ISO_Level5_Shift (0xcb)
> mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
> mod5        ISO_Level3_Shift (0x5c)
> 
> while on another:
> 
> shift		44 57	# Left Shift, Right Shift
> lock		30	# CapsLock
> control		58 64	# Control
> mod1		59 63	# Meta
> mod2		62	# AltGraph
> mod3		90	# NumLock
> mod4		60	# Left Alt
> mod5		65	# Compose
> 
> Without consulting the X11 modifier keymap (which is impossible from
> Lisp), how should a Lisp program derive any meaning from these modifier
> bits, or the keys to which they are assigned?

The idea is to report Shift_L, Shift_R, Alt_L, Meta_L not shift or alt. 
Maybe those keys are mapped to modifiers, maybe not.



  reply	other threads:[~2024-11-05  7:15 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 23:15 Physical keyboard events Cecilio Pardo
2024-10-29 13:40 ` Eli Zaretskii
2024-10-29 15:07   ` Cecilio Pardo
2024-10-29 15:38     ` Peter Feigl
2024-10-29 17:54       ` Cecilio Pardo
2024-10-29 23:41       ` James Thomas
2024-10-29 16:44     ` Eli Zaretskii
2024-10-29 16:55       ` Yuri Khan
2024-10-29 17:46         ` Eli Zaretskii
2024-10-30  2:56           ` Max Nikulin
2024-10-30  6:28             ` Yuri Khan
2024-10-30  6:39               ` Peter Feigl
2024-10-30 15:27               ` Eli Zaretskii
2024-10-30 17:13                 ` Yuri Khan
2024-10-30 17:37                   ` Eli Zaretskii
2024-10-30 19:26                     ` Dov Grobgeld
2024-10-30 19:36                       ` Juri Linkov
2024-10-30 19:55                       ` Eli Zaretskii
2024-10-31  6:13                     ` Yuri Khan
2024-10-30 15:21             ` Eli Zaretskii
2024-10-30 16:59               ` Max Nikulin
2024-10-29 17:56         ` Cecilio Pardo
2024-10-29 17:52       ` Cecilio Pardo
2024-10-29 17:13 ` Alan Mackenzie
2024-10-29 18:20   ` Cecilio Pardo
2024-10-29 19:31     ` Alan Mackenzie
2024-10-29 21:45       ` Cecilio Pardo
2024-10-30  6:02         ` Yuri Khan
2024-10-30 15:23           ` Eli Zaretskii
2024-10-30 16:51             ` Yuri Khan
2024-10-30 17:25               ` Eli Zaretskii
2024-10-30  3:27       ` Eli Zaretskii
2024-11-03 23:44 ` Cecilio Pardo
2024-11-04  0:21   ` Po Lu
2024-11-04  8:03     ` Cecilio Pardo
2024-11-04  9:35       ` Po Lu
2024-11-04 11:11         ` Cecilio Pardo
2024-11-04 11:49           ` Po Lu
2024-11-04 11:59             ` Cecilio Pardo
2024-11-04 13:29               ` Eli Zaretskii
2024-11-04 13:46                 ` Cecilio Pardo
2024-11-04 13:54                 ` Po Lu
2024-11-04 13:24             ` Eli Zaretskii
2024-11-04 14:09               ` Po Lu
2024-11-04 16:46                 ` Eli Zaretskii
2024-11-05  1:31                   ` Po Lu
2024-11-05  7:15                     ` Cecilio Pardo [this message]
2024-11-05  9:03                       ` Po Lu
2024-11-05  9:20                         ` Cecilio Pardo
2024-11-05 12:21                           ` Po Lu
2024-11-05 13:30                             ` Eli Zaretskii
2024-11-05 14:27                             ` Cecilio Pardo
2024-11-06  0:10                               ` Po Lu
2024-11-06 12:49                               ` Po Lu
2024-11-06 13:31                                 ` Eli Zaretskii
2024-11-07  0:25                                   ` Po Lu
2024-11-07  6:41                                     ` Eli Zaretskii
2024-11-07 14:36                                       ` Po Lu
2024-11-07 15:47                                         ` Eli Zaretskii
2024-11-07 16:58                                           ` Cecilio Pardo
2024-11-08  0:36                                           ` Po Lu
2024-11-05 13:13                     ` Eli Zaretskii
2024-11-04 13:18         ` Eli Zaretskii
2024-11-04 14:37           ` Po Lu
2024-11-04 16:49             ` Eli Zaretskii
2024-11-05  1:03               ` Po Lu
2024-11-05  7:09                 ` Cecilio Pardo
2024-11-05 13:06                 ` Eli Zaretskii
2024-11-04 12:27     ` Eli Zaretskii
2024-11-04 13:09       ` Po Lu
2024-11-04 13:33         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c1b4258-447f-433c-939e-21df7f9eeec3@imayhem.com \
    --to=cpardo@imayhem.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).