[Y-devel] Logical input devices

Maurice van der Pot griffon26 at kfk4ever.com
Sun Feb 29 14:17:30 GMT 2004


On Sun, Feb 29, 2004 at 02:32:54PM +0200, Mikko Rantalainen wrote:
> I think events should be something like
> array(timestamp,axis_id,value,delta[,min_val,max_val,granularity])
> where
> timestamp is unique sequence number (possibly with real time)
> axis_id identifies the axis. Might be "mouse x-coord" or "kb enter"
> value is the absolute value of axis
> delta is change to previous value
> min_val is the minimum value this axis may have
> max_val is the maximum value this axis may have
> granularity is the number of possible different values for this axis

I do not agree with you guys that there should be no difference
between analog and digital events. I understand your preference 
to make things as generic as possible in an attempt to accommodate
any devices people can come up with in the future. But you have
to realise that:

a) Analogue and digital are like true and false; they completely
   cover the entire value space, so any future input method will
   fall into one of these categories

b) Forcibly interpreting key presses as an axis overly complicate
   things. Because the key mapping software will walk through 
   a tree and make a step each time a certain event is generated, 
   we already know the events suitable for this will never come
   from analogue axes. You don't want to first force everything 
   into one form and then later check for the original type.

> But the important question is, should the logical device generate 
> the repeated events (like actual hardware keyboards do due to 
> historical reasons) or should the repeation be done only by 
> character input driver.

I suppose it would also be useful to check how it is done by X, 
but if I had to choose I would probably move the whole thing into
the driver or maybe even higher up in the software. You'll have
to provide indentically triggered but differently executed behaviour 
for sticky keys anyway.

> I think you missed one point. If we allow any key to work as a 
> modifier (which is an important improvement IMO), we must send 
> status of all the keys (=axis!) for every event - which would cause 
> events to get quite large. Or then we can make an assumption that 
> only a few keys are down for any given moment (probably true) and 
> charcter input driver can sort the things out and output a 
> combination of characters for the event. As I wrote above, we should 
> be able to use combinations like "a+b" so having a bitmask of 
> modifiers like X does isn't a choice. And I think we have to support 
> combinations of any keys to be able to transparently support 
> chording input for PDAs and other devices with very few buttons.

But you are also missing something: the keymap would define which
keys are modifiers and which keys cause a state transition in the
tree state. Therefore, you already know how many modifiers can be
pressed at the same time. You could even limit the number of modifiers
and call keymaps that define more than that number 'illegal'.

> >>4) Should the user be able to customize behavior of logical input
> >>device (emulation of different key emulations). Probably yes? If so,
> >>should the customization have some kind of API or should this be
> >>driver dependant? The same issue needs to be decided for the
> >>character input driver too.
> >
> >Yes, an API and supporting tools would be crucial for it to be usable.
> 
> Yes, API would be nice as it would allow generic perferences dialogs 
> but a fixed API for configuring input device and character input 
> driver would also limit future extensions on functionality of those.

What kind of configuration are you talking about?
(I'll limit myself to keyboards and buttons for now)
At the driver level each key of each type of device generates 
a virtual key code that can only be the same as any other if 
they have a corresponding conceptual position (such as "the key in 
the top right corner of the keyboard").

On a higher layer the keymap would determine for each virtual key 
code how it changes the state in the tree. Once a virtual key moves
the state to a leaf, a character string is generated.

Naturally some tools would have to be made to support both the 
creation of a mapping between a new device's scan codes and its
virtual key codes, and the mappings between key code sequences
and character sequences (keymaps).

Maurice.




More information about the Y-devel mailing list









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