emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New key binding syntax


From: Alexandre Garreau
Subject: Re: New key binding syntax
Date: Fri, 05 Nov 2021 10:13:11 +0100

Le vendredi 5 novembre 2021, 09:56:26 CET Yuri Khan a écrit :
> On Fri, 5 Nov 2021 at 13:08, Alexandre Garreau <galex-713@galex-713.eu> 
wrote:
> > > The rollover behavior works entirely on the application side, where
> > > the OS and the GUI toolkit send events like “the key at position
> > > AB02
> > > was pressed while the left Alt is down; by the way, the character
> > > for
> > > this key in the current layout is x”. If the application reacts to
> > > key
> > > press and autorepeat events and takes the character and modifiers
> > > from
> > > them immediately, the “AC01 down (char a), AB05 down (char b), AC01
> > > up
> > > (char a), AB05 up (char b)” sequence results in an “a then b” text
> > > input. But some applications (notably games) just track the whole
> > > bit
> > > array of keys.
> > 
> > But what happens after 7 consecutive down on a typical keyboard then?
> 
> Technically what happens in that highly theoretical example depends on
> the firmware implementation; in the USB protocol, there is provision
> for the keyboard reporting “the user held down so many keys I can’t
> accurately report them all”.

so it’s like a down, b down, …, f down… and then until I release any key 
between a and f, if I press down “g”, the keyboard won’t say anything to 
the application/OS?

> > why this limitation since each key succeeds the previous one?
> 
> Each key does not “succeed” the previous one. Keyboards are not only
> used for text input but also for gaming and (rarely, with advanced
> users) chord input, and they must be able to report at least a few
> keys held down simultaneously,

wdym by “simultaneously”? “close enough in time of pressing”? or “while 
the others haven’t been released yet”?

> and the exact moment they are released.
> In a game, it’s not an unusual situation that you hold down one key to
> crouch, another to keep moving (crawling?) forward, and a third one to
> turn left or right, while periodically pressing a fourth key to fire.
> If the keyboard reports the release too early, you stand back up, and
> your enemies notice you.

I know that, and actually the best usage of key chords, key sequences and 
combos I’ve seen is indeed in FPSes.

> The limitation is about the keyboard state report having a manageable
> size. With this particular format, the 8 modifiers are reported as a
> bit mask in a single byte, then there is a mostly reserved byte, then
> 6 bytes contain the codes of keys currently held down.

what? I thought the usb kbd firmware worked by sending events that 
triggered interruptions, not that it stored keystate itself :o I thought 
keystate was saved and registered application-side, with each event




reply via email to

[Prev in Thread] Current Thread [Next in Thread]