[Y-devel] keyboard layouts (continued)
Maurice van der Pot griffon26 at kfk4ever.com
Sun Feb 29 15:03:48 GMT 2004
On Sun, Feb 29, 2004 at 03:20:49PM +0200, Alexey Boyko wrote:
>
> > > 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 have tryed GTK2 input method "cyrrilic transliterated" (right click on GTK
> entry widget), So, when I pressed a key, which can typed through and is a
> part of key sequence (next key may modify this char) then this char is
> underscored until I press another key. If key will be processed in input
> driver, then I dont know how to give such hints. Chars can appears in pairs.
>
> Sorry, if my bad english does not describe this effect well.
I understand what you mean. You are describing what is in section 2.3 of this article:
https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=KeybrdDesign
If giving the hints was the only problem, we could simply generate a second
type of event that contains only intermediate characters. The application
could choose to ignore them, because the actual string of characters would
always be sent later anyway. Or it could use the information to give visual
feedback to the user.
Unfortunately, that still leaves the problem that it is not always possible
to display intermediate characters in the font being used even though the
combined character is valid.
I suppose we could leave this up to the application with the above mentioned
approach of sending intermediate events.
> As I read at your link, Mac keyboard generate event only when key with
> modifier was pressed, passing key and modifier flags into driver. Then, if
> such event was catched, keyboard driver can itself generate modifier
> pressing/releasing key events.
>
> For example if Meta+Q catched by driver it sends event Meta press, Q press, Q
> release Meta release.
Right. Of course the only reason to make the driver do this is to make our
lives easier: traversing the tree would be done the same no matter what the
hardware generates. We could also just always do it the way the Mac does it
and send keys accompanied with modifier states to the tree traverser.
As I just explained in a response to a message from Mikko Rantalainen with
subject [Y-devel] Logical input devices, the driver would already know what
keys it was to use as modifiers when it translates scan codes into virtual key
codes. (We'd just have to make sure that Mac kb drivers never allow you to
try and use the modifiers as normal keys ;) )
What do you think is the best approach? Sending modifier events separately
or sending a modifier state along with normal keys that are pressed?
> > traversing the tree. Where it does bother us is with the implementation of
> > things like sticky keys (as mentioned by Bryce I think).
>
> About sticky keys I do not thinks yet. May be keyboard driver can do it.
Yeah, I'm starting to feel that is indeed the only place to do it. Maybe
somebody (Kris van Hees?) can give some insight into how sticky keys are
supposed to work. For example, if sticky keys are used, are always all
modifiers sticky?
> Hm. I think, it not possible cleanly. If we will remap qwerty/other in
> keyboard driver then all shortcuts will be moved with keys, or all shortcuts
> will stay in their places. Or it behavior left on application.
I think we can figure something out, see below.
> > 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.
>
> My idea is, that shortcut Ctrl+A always means that we press Ctrl then press
> key on which printed letter 'A'. Keyboard driver convert scan codes to
> virtual keys accordingly letters on keys. if in qwerty keyboard key 'Q'
> generate 'Q' virual key, then on azerty keyboard it will generate 'A' virtual
> key. So shortcuts always moved with keys.
qwerty and azerty keyboards are physically the same keyboard, so if you want
to use a dvorak layout on either of them, the mapping of key location to
character output should be identical. That means that also the mapping of
key location to virtual key code should be identical. Otherwise you would
have to have a dvorak keymap for each different type of keyboard.
> If you have another view on key processing, describe it. (better by diagrams)
Let's call the physical location of the q key on a qwerty and the a on an
azerty VK_TOPLEFTLETTER. Let's also assume the location of the q on azerty
generates VK_LEFTCENTERLETTER.
Suppose a shortcut ctrl-q (to quit) was as common as ctrl-c and ctrl-v are.
Then look at this table:
currently selected preferred key to use for ctrl-q virtual key code
keymap (expressed in what is on the keycap) generated
QWERTY Q VK_TOPLEFTLETTER
AZERTY Q VK_LEFTCENTERLETTER
Cyrillic (looks like an arch with a diagonal slash) VK_TOPLEFTLETTER
Now you have two choices:
1) You express shortcuts independently of keymap in virtual key codes
Result: If you switch from QWERTY to AZERTY, you suddenly have to press ctrl-a
2) You express shortcuts in the characters that are output, which is keymap
dependent, so you would have a set of shortcuts for each keymap you use.
Result: You can switch between Cyrillic and QWERTY as long as you have
two shortcuts (ctrl + arch with slash = quit) and (ctrl + q = quit).
The last option is a bit more work because you have to define shortcuts for
all keymaps you use, but at least you can get it to work the way you want.
If you want shortcuts to move, that's fine. If you don't, that's fine too.
Because shortcuts for a large part are going to be system-wide, we are in
the position to build in enough support (in the form of tools) to make
things easy for the user.
> > > 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.
>
> I think no significal difference.
Didn't someone mention 1 keymap per focus? I think there should be 1 keymap
and 1 input tree state per focusable object.
> btw. What keyboard you are using? I'm using qwerty keyboard with cyrillic
> letter printed under latin letters by red color.
I'm just using a us-qwerty kb.
> I like when shortcuts binded to latin letters, because they independed of
> language I types text.
You wouldn't mind if the shortcuts were bound to both letters on the same key.
For all you know that is already the case ;)
Maurice.
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved