Input: Add smooth-scrolling support to GetPointerEvents
For scroll wheel support, we used to send buttons 4/5 and 6/7 for horizontal/vertical positive/negative scroll events. For touchpads, we really want more fine-grained scroll values. GetPointerEvents now accepts both old-school scroll button presses, and new-style scroll axis events, while emitting both types of events to support both old and new clients. This works with the new XIScrollClass to mark axes as scrolling axes. Drivers mark any valuators that send scroll events with SetScrollValuator. (Currently missing: the XIDeviceChangeEvent being sent when a driver changes a scroll axis at run-time. This can be added later.) Note: the SCROLL_TYPE enums are intentionally different values to the XI2 proto values to avoid copy/overlapping range bugs. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
@@ -37,6 +37,22 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
* Interface available to drivers *
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Scroll flags for ::SetScrollValuator.
|
||||
*/
|
||||
enum ScrollFlags {
|
||||
SCROLL_FLAG_NONE = 0,
|
||||
/**
|
||||
* Do not emulate legacy button events for valuator events on this axis.
|
||||
*/
|
||||
SCROLL_FLAG_DONT_EMULATE = (1 << 1),
|
||||
/**
|
||||
* This axis is the preferred axis for valuator emulation for this axis'
|
||||
* scroll type.
|
||||
*/
|
||||
SCROLL_FLAG_PREFERRED = (1 << 2)
|
||||
};
|
||||
|
||||
extern _X_EXPORT int InitProximityClassDeviceStruct(
|
||||
DeviceIntPtr /* dev */);
|
||||
|
||||
@@ -51,6 +67,13 @@ extern _X_EXPORT Bool InitValuatorAxisStruct(
|
||||
int /* max_res */,
|
||||
int /* mode */);
|
||||
|
||||
extern _X_EXPORT Bool SetScrollValuator(
|
||||
DeviceIntPtr /* dev */,
|
||||
int /* axnum */,
|
||||
enum ScrollType /* type */,
|
||||
double /* increment */,
|
||||
int /* flags */);
|
||||
|
||||
/* Input device properties */
|
||||
extern _X_EXPORT void XIDeleteAllDeviceProperties(
|
||||
DeviceIntPtr /* device */
|
||||
|
||||
Reference in New Issue
Block a user