[Y-devel] Logical input devices
Mikko Rantalainen mira at cc.jyu.fi
Sun Feb 29 12:32:54 GMT 2004
Bryce Nichols / 2004-02-29 02:59:
> Great ideas for input devices. Read my responses to specific points
> below.
>
> On Sat, 28 Feb 2004, Mikko Rantalainen wrote:
>
>
>>Logical input device should be able to provide value of every axis
>>*and* granularity of that axis *and* information if the axis is
>>relative (like mouse movement, no limits) or absolute (like joystick
>>movement, physical movement +/- 45 degrees). This allows us to be
>
> Yes, excellent idea. The hard part is deciding on a standard for
> representation of the logical devices as well as the format for events.
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'm not sure if the last three values should be transmitted with
every event as those should be static for the axis and could be
queried only once if the information is required.
The reason we need both value and delta is that, for example, mouse
movement is usually limited to screen's resolution which might be
something like 1024x768. So the "mouse x" axis could have min_val of
0 and max_val of 1023 and granularity of 1024. However, it could be
that "mouse x" axis has already value of 0 when the mouse is moved
towards left and that should result to event where value is still 0
but delta gives the actual movement (that is, delta would be some
negative value). Perhaps the input system should support more
precision than a single pixel for mouse axis. For normal usage it
wouldn't matter but if one uses Gimp, for example, the extra
precision would be nice. I still like that the min_val and max_val
would match the screen's resolution so perhaps we have to use
floating point numbers for value and delta?
Note that mouse movement would usually generate two events, one for
each axis.
>>Some things to consider:
>>1) which level should handle repeating of characters when the key
>>has been pressed for some time?
>
> This is somewhat complicated, so we should think carefully about how to
> make this work in a clean, consistent manner. The general appoach, I
> think, should be that after the initial delay, while a key that triggered
> a "key typed" event is still depressed, repeat "key typed" events will be
> sent until the key is released or some modifier changes.
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.
>>2) I think we should allow any key to work as a modificator (instead
>>of simply Ctrl, Alt, AltGr, Shift, Meta, Super, Hyper). However,
>>current keyboards give output of "a" and "b" in case of the
>>following key sequence: "a down", "b down", "b up", "a up". Should
>>Y's logical character driver generate characters "a","b","a+b" or
>>"a","a+b","b" (I think it should be the latter). Does it matter?
>
> We may want to make the behavior for this sort of thing configurable.
>
>
>>3) How should the characters be outputted from the driver. If we
>>allow any key combination, we cannot output a character with a full
>>mod key bitmap like X does. Perhaps an array of all currently
>>pressed keys?
>
> Yes, send the set of modifiers currently in effect.
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.
>>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.
--
Mikko
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved