diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-15 12:33:04 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-09-02 14:53:01 +1000 |
commit | 7d5a303cd8976a7eac1b96897c70d5d25c57ecf1 (patch) | |
tree | 99ff6c9c2896ed0c7a2bbce6257de333178e8ec7 /XI2proto.h | |
parent | 186aa20619d1720bde49fd92d2834c8f9eadf49b (diff) |
Move scroll information into a new class.
Using labels only to mark smooth scrolling axes disallows scrolling from
hardware events (e.g. a mouse wheel). If those axes are marked as scrolling
axes instead, the clients lose information which hardware axis this event
corresponds to.
For example, on Wacom devices, the client can benefit from smooth scrolling
on the strip or wheel event but may still require the knowledge whether the
axis is a vertical strip (e.g. Intuos3) or a absolute scrolling wheel (e.g.
Intuos4).
Thus, add a new class to XIQueryDevice that represents scrolling information
on a valuator. One of these ScrollClass may exist for each ValuatorClass if
that valuator is a scrolling valuator. The increment field of this class
removes the requirement for 1.0 == 1 unit of scrolling.
This isn't true in most cases, especially where physical scroll axes are
involved. Wacom Intuos4 scroll rings have a unit size of 3.0 and the driver
historically sent one scroll event per 3.0 increment or decrement. Mapping
one scroll event to 1.0 makes the ring mostly unusable through legacy
button events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'XI2proto.h')
-rw-r--r-- | XI2proto.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -188,6 +188,21 @@ typedef struct { uint16_t pad2; } xXIValuatorInfo; +/*** + * Denotes a scroll valuator on a device. + * One XIScrollInfo describes exactly one scroll valuator that must have a + * XIValuatorInfo struct. + */ +typedef struct { + uint16_t type; /**< Always ValuatorClass */ + uint16_t length; /**< Length in 4 byte units */ + uint16_t sourceid; /**< source device for this class */ + uint16_t number; /**< Valuator number */ + uint16_t scroll_type; /**< ::XIScrollTypeVertical, ::XIScrollTypeHorizontal */ + uint16_t pad0; + uint32_t flags; /**< ::XIScrollFlagEmulate, ::XIScrollFlagPreferred */ + FP3232 increment; /**< Increment for one unit of scrolling */ +} xXIScrollInfo; /** * Used to select for events on a given window. |