[Y-devel] Key mappings
Maurice van der Pot griffon26 at kfk4ever.com
Sun Feb 29 01:30:51 GMT 2004
On Sat, Feb 28, 2004 at 07:21:11PM +0100, Rupert Mazzucco wrote:
> On Sat, 28 Feb 2004, Maurice van der Pot wrote:
>
> I think it's a good summary of yesterday's discussion, and I basically
> agree with everything you say. However, today I browsed this document
> "An introduction to keyboard design theory" at scripts.sil.org, and that
> offers a different view on the problem (without being really contradictory).
A very good document indeed.
> The basic idea is, I think, to get away from this Xish idea of a keymap
> as some one-to-one mapping that directly produces output. The actual problem
> is to have a set of rules that transform a "sequence of keystrokes" into
> some output code, which for us would be either a Unicode codepoint, or a
> "special keycode" that can *then* be "mapped" (this is *not* the "keymap"
> but something higher up at probably application level!) to what you call
> an "action".
Well, we already figured that out ourselves. See here:
https://www.y-windows.org/pipermail/y-devel/2004-February/000696.html
What _is_ new to me in the article is the idea of not using the keys that
were pressed as a state, but rather the produced output. However, I fail
to see the advantage of this approach.
The author writes (see 4.1 - Types of rules):
An alternative approach is to describe rules in terms of keystrokes
and previous output.
[...]
Now it does not matter what happens <-- why should it?
if I delete some character in the
output (for example by pressing backspace), since all subsequent
keystrokes are interpreted in terms of the context that the user is
seeing. Thus the memory that the keyboarding utility is working with
is the same as what the user is seeing, rather than with keying sequences
where the memory is in terms of what they user typed, which may bear
little resemblance to what is on the screen. Using previous output as
context, therefore, provides a very powerful approach to describing
keyboards. In effect, each rule stands alone considering only the
keystroke and the textual context in which the keystroke occurs.
There is no need for the keyboard to have any memory (as per dead
keys or rules in terms of input keystrokes only), it just needs to be
able to get the textual context and the keystroke and then to be able
to edit that textual context.
What point is the author trying to make here? That you don't need any
memory for the state if you have access to the generated output?
If that is all he's saying, then this method is unsuitable for what
we are making because we cannot access the generated output, nor can
we store enough generated output to cope with any number of backspaces.
(Because there simply is no such thing as 'enough generated output')
Why anyone would call this method 'powerful' is also not clear to me.
I'd simply call it 'different' =]
By the way, I assume he means "keyboarding utility" instead of "keyboard"
near the beginning of the last sentence of this paragraph.
Another problem that we need to solve is the input of CJK (see 2.4 -
Candidate window). Naturally the input subsystem can't open a window
all by itself. We may have to provide some interface to allow a system
utility to open the window for us, but we must take care not to expose
too much of the lower layers in the API. If you offer something that
should not be used, you can be pretty sure it will be anyway (Murphy).
Personally I think it would be great if we could figure out a way to
give applications all the flexibility they need _without_ exposing
anything below Actions (Utopia? ;) )
Finally, the part about sequence checking (see 3) nicely pointed out that
not every possible combination of unicode characters is a valid one. This
is something that keymap writers should take into account. A check that
would best be automated in the form of a keymap verification utility imho.
> On the lowest level we still need some description of the physical keys,
> that maps the scancode to some low-level semantic like "where is the key
> and how does it look" so that 'a_phys' and 'compose' are defined, ie the
> "keyboard layout". But I propose that this never change (unless you physically
> replace the keyboard, of course). All "remapping" would occur on the
> "rules" level or - in the case of special keys to actions - even on the
> app level.
This was the layer that I said was missing in my description. Although we
may decide to use names derived from a us keyboard, we should really make
sure that this is not misunderstood by anyone: the names only reflect the
position of keys on the keyboard. a_phys just means the left-most symbol
key on the third row from the bottom.
Another thing I'm also interested in is the generation of events by
pressing modifier keys. According to the following post, modifier keys
never generate any events on their own on the Mac:
https://www.geocrawler.com/mail/msg.php3?msg_id=1396785&list=140
Could anyone with a Mac please verify this/try this out with xev?
Maurice.
P.S.: Rupert, I am available for discussion tomorrow... uh today (Sunday)
most of the day starting at 11:00.
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved