From 69d6ff3e01263ce2d52ed18b08f054bf3fdb923c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 2 Aug 2009 12:03:04 +0300 Subject: evdev: Use the EvdevPost...Event() functions in the emulation code. This is similar to commit 1f641d75edba7394201c1c53938215bae696791b. It provides the same functionality of queuing the (in this case emulated) events and waiting until an EV_SYN synchronization event is received before posting them to the server. This preserves the order of events (both real and emulated) and ensures that MotionNotify events will always be posted first. It also unifies the event posting into a few small functions which improves maintainability. From this point on, you should never use the xf86Post...Event() functions in new code, but rather the EvdevPost...Event() versions. Signed-off-by: Peter Hutterer --- src/evdev.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/evdev.h') diff --git a/src/evdev.h b/src/evdev.h index 23ee003..142801c 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -25,6 +25,7 @@ * Kristian Høgsberg (krh@redhat.com) * Adam Jackson (ajax@redhat.com) * Peter Hutterer (peter@cs.unisa.edu.au) + * Oliver McFadden (oliver.mcfadden@nokia.com) */ #ifndef EVDEV_H @@ -179,6 +180,14 @@ typedef struct { EventQueueRec queue[EVDEV_MAXQUEUE]; } EvdevRec, *EvdevPtr; +/* Event posting functions */ +void EvdevPostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value); +void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value); +void EvdevPostButtonClicks(InputInfoPtr pInfo, int button, int count); +void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v, + int v[MAX_VALUATORS]); +void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v, + int v[MAX_VALUATORS]); unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code); /* Middle Button emulation */ -- cgit v1.2.3