[Y-devel] keyboard layouts (continued)

Maurice van der Pot griffon26 at kfk4ever.com
Sun Feb 29 11:32:50 GMT 2004


On Sun, Feb 29, 2004 at 12:22:58PM +0200, Alexey Boyko wrote:
> 
> > I disagree with you on this. If you have a modifier key and you press it
> > first and then delete it, 
> 
> What means "delete modifier key"? release modifier key?

Yeah, I meant release. Forgive me, it was late =]

> > you will be in the same state as before you
> > pressed it. What the modifier key does is temporarily switch between two
> > trees. This of course means that multiple trees must have similar shapes,
> > but I don't think that is a problem. We can make verifiers that can check
> > a new keymap for consistency.
> 
> How to describe two trees in keymap file?

I thought it over a little more and you are right. Even if we allow any key
to be a modifier, each normal key would have an associated set of modifier
states. The key together with these modifier states would determine the 
step in the tree.

> Now I meets with one tip, which I forgot first time. If after "e" we press 
> another key (not semicolon) we must enter cyrillic e (without dots), and then 
> process new key.

Right.

> > I agree with Bryce that limiting modifiers to the standard ones may not
> > be a good idea, but I also noticed that Macs apparently define certain keys
> 
> Keyboard driver determine, which key will be modifier.

If you mean the X keyboard driver, then yes. And since we're not using X we
can and will be in control of what modifiers do (as far as hardware allows).

> > as modifiers in hardware, meaning that you don't get events for them.
> >
> >   https://www.geocrawler.com/mail/msg.php3?msg_id=1396785&list=140
> 
> Keyboard driver will preprocess keyboard events to sequence of keysym events.

I'm not sure what you mean, but I do realise now that even if the hardware
doesn't generate events for shift for example, that does not bother us in
traversing the tree. Where it does bother us is with the implementation of
things like sticky keys (as mentioned by Bryce I think).

> > This is no problem for the 'multiple trees that you switch between' idea,
> 
> Explain, how to switch trees with modifier keys?

Forget it, I dropped the idea because it's not useful.

> > but it does prohibit the use of modifier keys as normal character
> > generating keys.
> 
> Yes. If Mac keyboard hardware processes modifier key itself we can not do 
> anything. But we can process shotcuts anyway.

Agreed.

> > What I do not understand is why you would want to split things up into a
> > shortcut module and a (shift module+)character map module. In my view the
> > shortcut module, which is concerned with what I call Actions, was just a
> > layer of abstraction on top of the character map module.
> 
> Then it will depends on character map, which is selected current. I think 
> shortcuts module (or Actions module) must accept virtual key codes from input 
> driver.

I am not so sure about this. I have seen that in some cases you would like to
have the shortcut move when you change the map (ctrl-q when you change from 
qwerty to azerty) and in others, you would like to keep them on the same 
physical key (ctrl-c/ctrl-v when you switch to a map without c and v).

Therefore I think it would be better to allow multiple shortcuts for the same
action and make only one active (depending on which keymap you're using).
I realise that this means there has to be communication between the layer
handling actions and the layer handling keymaps, but I don't see a better
solution at the moment.

> > Could you explain as well why you would like to make a distinction between
> > key press/release events and typed character events?
> 
> As I described above. key press/release events always the same. Their number 
> is equals to number of keys on keyboard and not depended how many characters 
> in current language.

We first need to see if we can agree on the interaction between keymaps and shortcuts.
Then we can talk about this.
 
> > qwerty and dvorak are not necessarily different keyboards. The differences
> > are in the location of keys with certain scan codes, for example some
> > keyboards have the key with scan code 0x2b above the enter, others have it
> > to the left of it.
> > (https://www.bhashaindia.com/knowledge/view%20lists/scancode.aspx)
> 
> So, with applied mapping, key on which printed letter 'A' will always generate 
> virtual key code 'A', independent where is key located, and what scan code it 
> have.

No, not independent of where it is located. The scan codes are translated into
virtual key codes that indicate the position on the keyboard. If you look at 
the part of the keyboard where all letters are, at the left in the middle there
is an 'a' on a us keyboard. The virtual key code for this key would tell you
that it is the 'left-most key on the middle row within the block of letters', 
it would not tell you that it's an 'a'. This is the lowest kind of mapping that
we have. 

In all keyboards I have used, that particular key generates a scan code of 0x1e
and the keycap showed an 'a'. But if someone were to make a keyboard where the 
key in that position generated scan code 0x62 and had a '3' on its keycap and
'a' was located somewhere else on the keyboard and the key that generated 
scan code 0x1e was on yet another position on the keyboard, the 'left-most 
key on the middle row within the block of letters' would still generate the 
same virtual key code as the 'a' key on my normal keyboard.

At a higher level there is of course the keymap that is concerned with which
key generates what character.

> > > Character map module must have access to widget data, where it stores
> > > input context.
> >
> > Input context? Do you mean the character map module should be able to
> > retrieve what it produced?
> 
> No, input context contains current position in the tree for this widget.

So would you have a state per widget? Would you also have a keymap per widget?
I agree that you may want to keep the state within a window even if it loses
focus for a while, but per widget seems overkill.

Maurice.




More information about the Y-devel mailing list









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