[Y-devel] keyboard layouts (continued)

Rupert Mazzucco maz at ap.univie.ac.at
Mon Mar 1 18:37:12 GMT 2004


On Mon, 1 Mar 2004, Maurice van der Pot wrote:

>                 +---------------+
>             |Keyboard driver|
>             +---------------+
>                     |
>                         |  virtual key codes
>                         V
>             +----------------------+
>             + Character processing |
>             +----------------------+
>                         |
>                         |  characters + modifier state
>                         V
>                   +-----------+
>                   | shortcuts |
>                   +-----------+
>                         |
>                         |  Actions
>                         V
>                     Application

Exactly.  I think you've got the basic design of the baby.  I herby suggest
to baptise it "Y Input Event Manager".  But maybe we can even generalise your
approach a bit:  The "keyboard driver" can be a generic "input driver", the
"virtual keycodes" can be "virtual event codes" (that specifically includes
mouse clicks), "character processing" turns into "event processing" (that's
the decision tree thingy), the output of which will be a "Unicode codepoint"
instead of "characters+modifier state" (we can assign codepoints from the
private section to indicate non-character events; most mouse events will pass
right through to here and wear the same hat as "shortcuts").

The output queue of the "event processor" will be filtered for events that
are processed in the server ("stage 1"), what remains in "stage 2" is offered
to the app, if not taken after some time, again processed by the server (most
probably simply discarded; that also addresses the latency issue someone
brought up).  BTW, has anybody a rough idea of how many events we'll have
to process per second?  I wonder if we could make some use of those 11 bits
in utf32_t and reduce everything to manipulation of single integers.

>  - You would like to make sure it is easier for application developers
>    to use the system-wide shortcuts than to handle the keys themselves.
>    If it's not easier, it's not going to be used.

Idea: There are always system-wide default actions for all shortcuts
that are reasonably reasonable, even if it's to discard the event.  That
means all widgets must implement some reaction to those events.  If the
application doesn't handle them, it gets the default.

>  - What part of the software should be responsible for changing shortcuts?

Two possibilities: Either the decision tree/rules set is changed ("remapped"),
which would change the association of event sequences and actions system-wide,
or the application chooses to handle a shortcut itself (provided it is allowed
to receive it!) and attaches some private action to it.  A special case of
the second is the special application "window manager"; that would produce a
quasi-system-wide change without affecting the deeper levels.

>    * Should the application delegate all shortcut changes to the system?

No, that'd require another translation layer that figures out what the
current shortcut->action mapping is.  Or that one application can change
the behaviour of others, which I strongly dislike. (exception wm, see above)

>  - Should it be allowed to use a different shortcut for Paste in some
>    application while still keeping the system-wide default for others?

Would be possible, but for the sake of consistency not encouraged.

>  - How does an application know which keys will be free for use?

It polls the event queue and can take everything it finds there.

What do you think?

Regards,
Rupert

PS. The two-state keyboard mentioned here could be understood as a Morse
    device.  If some funny guy wanted to use such a thing as input device,
    he only needed to find a way to plug into the USB and, with the design
    sketched above, Y could do the rest.




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved