[Y-devel] keyboard layouts (continued)

Maurice van der Pot griffon26 at kfk4ever.com
Mon Mar 1 23:53:35 GMT 2004


Hi Rupert,

I think you'd better jump straight to the string "BOING" somewhere near 
the bottom of the mail and read that stuff first. That's where I noticed 
we had a fundamental difference in our interpretation of the diagram.

On Mon, Mar 01, 2004 at 07:37:12PM +0100, Rupert Mazzucco wrote:
> On Mon, 1 Mar 2004, Maurice van der Pot wrote:

How's this:

  The Y Input Event Manager:

                 +---------------+
                 | Input driver  |
                 +---------------+
                         |
                         |  virtual event codes
                         V
             +----------------------+       if qwerty, then 'q', if azerty then 'a',
             +   event processor    |  <--  if composite then advance state in tree
             +----------------------+       those kinds of decisions
                |        |
      +---------+        |  Unicode codepoints
      |                  |
      V      +-----------|-------+ 
   window    | check     |       |
   manager   |  for -->  +-------|-----+    
             | shortcuts |       |     |
             +-----------|-------+     | Unicode codepoints not
                         |             | assigned to system-wide
                 Actions |             | shortcuts
                         V             V
                     ===== Application =====   

Btw, the 'event processing' is based on sequential processing, so we'll just
make that a swappable module as Chris Amshey suggested. That way we can keep 
it the way we discussed without having to worry about chording keyboards for 
instance.

We will have to talk about multiplicity of that part. I think there can be 
multiple event processing modules all sending to one 'shortcut processor' 
(better name anyone?).

> 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").

I suppose it's ok for mouse events, but what do we do with modifiers? 
We would have to limit the number of modifiers or we would quickly run out 
of code points for private use (there are about 132K of them). Of course
making a tree that has more than some 18 modifiers is insane, but still.

I just think that there is no real advantage of merging the modifiers into
the code point just to unpack them one level higher up (or actually lower in 
this diagram).

And you WILL have to unpack them, because the application should be able to 
tell the user what shortcut is defined (e.g. Ctrl + 'a'). Which leads me to 
my next point: we will have to name the modifiers in a way that is meaningful 
to the user. It would be part of the tree configuration in the event processor.


By the way, I could use some convincing on the point of allowing composite
modifiers. As I said before, I don't see the use of them. And if we don't 
support those, the modifiers can be kept out of the tree themselves...
they'd only influence the state of the tree by being active when the next
normal key is inserted into the event processor. 

You said earlier that the distinction between modifiers and normal keys is 
a bit artificial, but I totally disagree on that. Modifiers themselves don't 
(have to) change the state of the event processor at all. They are only 
important in combination with a non-modifier key.

The argument made by Bryce (iirc) was that it would be useful to have some
multiple-key combination to trigger a different kind of input (like kanji).
But that just sounds like an event processor configuration change to me.

Keeping the modifiers separate also allows you to keep them more easily 
configurable. An event processor configuration would define, say, 5 modifier
keys (by location) and the user could choose the shift, ctrl, etc.

So if nobody can come up with a valid reason to allow key-sequences for
modifiers, could we keep them out of the tree please? =]

Another thing is that we need some keys or key combo's that you can use 
from anywhere. Mark already decided to have a key (modifier) to be used 
for sending things to the window manager. I think that this means that each 
event processor configuration should reserve one modifier for that. And here 
the configurability of the modifier functions also comes in handy.

Now pressing any non-modifier key while holding the window manager modifier 
would reset the tree state to the beginning and have the event processor 
interpret that key. As long as keys are entered together with the modifier
the state keeps advancing until a leaf is reached, causing a code point
to be sent to the window manager. If a key is pressed while the modifier
is not pressed, the tree state will reset again and start composing a
code point for the application.

> 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).  

What kinds of things would be filtered out? What are these stages?

> >  - 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.

So what would you propose to be the default handling for Paste?

> >  - 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. 

Ehm, the decision tree is the way your keyboard is mapped. As I always use 
qwerty on a US keyboard, my tree would always stay the same.
What I _would_ like to be able to change, is the default bindings of 
ctrl-c to copy and ctrl-v to paste for instance. This changing of 'the 
association of event sequences and actions system-wide' is nothing more than 
changing a shortcut.

(I noticed I used the word keymap in the following paragraph instead of event 
processor configuration or event processor tree, but you know what I mean)

The whole use of system-wide defined actions is that choosing the shortcuts
for these actions is not part of the application anymore (at least not by 
default). Even though a change in keymap switches the default set of system-wide
shortcuts, the translation from code points into Actions is really quite 
unrelated to keymaps.

Let's talk Utopia for a second. For all functions that an application has to
offer, there is a system-wide action defined, so all shortcuts to control the
application are defined already. Now what if the user decides to change a certain
shortcut?

I just realised that it would probably be best to ask the user if he/she wanted
to change the shortcut system-wide or just for that particular application.
Hmm, that doesn't sound that bad at all =]
If the user changes the shortcut to Paste for just that particular application, 
the application will no longer register itself for the system-wide action and 
the 'shortcut processor' (hate that name) would pass along the code point that 
would normally be converted into a Paste action.

> 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.

What 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.  

BOING That was the whole point of the shortcut processor. What did you think that 
part was for? The shortcut processor will promote consistency between applications
by providing standard associations between a code point and an action.

You can now jump back to the beginning of this message again and start reading
the rest. =)

> Or that one application can change
> the behaviour of others, which I strongly dislike. (exception wm, see above)

Well, maybe it's not such a problem if the application (or maybe even the 
system) pops up a dialog as I described ("Do you want to change this 
shortcut globally or only for this application?")

> >  - 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.

Right. User's choice with a dialog.

> >  - How does an application know which keys will be free for use?
> 
> It polls the event queue and can take everything it finds there.

Yeah, but it will have to show it's own shortcuts in the menu's before
they were used. You can't just have an application take the first key 
that isn't filtered out for an Action and assign that to the first function
that still doesn't have a defined shortcut ;)


> What do you think?

I think I've been typing way too much and should have been lying in bed
about 51 minutes ago.

 
> 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.

=]

Can't wait to read your reply.

Maurice.




More information about the Y-devel mailing list









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