mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-24 18:04:00 +00:00
Rename parts of the Post API to a Queue API.
Button and key events aren't posted from EvdevPost*Event, they are simply enqueued onto the evdev-internal event queue until the next EV_SYN arrives. Rename those interfaces from EvdevPost* to EvdevQueue* and leave only those that actually post to the server with a matching "*Post*" name. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
This commit is contained in:
@@ -158,7 +158,7 @@ EvdevDragLockLockButton(InputInfoPtr pInfo, unsigned int button)
|
||||
state = pEvdev->dragLock.lock_state[button - 1] ? FALSE : TRUE;
|
||||
pEvdev->dragLock.lock_state[button - 1] = state;
|
||||
|
||||
EvdevPostButtonEvent(pInfo, button, state);
|
||||
EvdevQueueButtonEvent(pInfo, button, state);
|
||||
}
|
||||
|
||||
/* Filter button presses looking for either a meta button or the
|
||||
|
||||
@@ -198,7 +198,7 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
|
||||
|
||||
pEvdev->emulateMB.pending = FALSE;
|
||||
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
||||
EvdevPostButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
pEvdev->emulateMB.state =
|
||||
stateTab[pEvdev->emulateMB.state][4][2];
|
||||
} else {
|
||||
@@ -248,12 +248,12 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
||||
|
||||
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0)
|
||||
{
|
||||
EvdevPostButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
ret = TRUE;
|
||||
}
|
||||
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0)
|
||||
{
|
||||
EvdevPostButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
|
||||
* If the button is released early enough emit the button
|
||||
* press/release events
|
||||
*/
|
||||
EvdevPostButtonClicks(pInfo, button, 1);
|
||||
EvdevQueueButtonClicks(pInfo, button, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
|
||||
/* Produce button press events for wheel motion */
|
||||
while(abs(axis->traveled_distance) > pEvdev->emulateWheel.inertia) {
|
||||
axis->traveled_distance -= inertia;
|
||||
EvdevPostButtonClicks(pInfo, button, 1);
|
||||
EvdevQueueButtonClicks(pInfo, button, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
src/evdev.c
22
src/evdev.c
@@ -250,7 +250,7 @@ static int wheel_left_button = 6;
|
||||
static int wheel_right_button = 7;
|
||||
|
||||
void
|
||||
EvdevPostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||
EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||
{
|
||||
int code = ev->code + MIN_KEYCODE;
|
||||
static char warned[KEY_CNT];
|
||||
@@ -298,7 +298,7 @@ EvdevPostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||
}
|
||||
|
||||
void
|
||||
EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value)
|
||||
EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value)
|
||||
{
|
||||
EventQueuePtr pQueue;
|
||||
EvdevPtr pEvdev = pInfo->private;
|
||||
@@ -317,13 +317,13 @@ EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value)
|
||||
}
|
||||
|
||||
void
|
||||
EvdevPostButtonClicks(InputInfoPtr pInfo, int button, int count)
|
||||
EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
EvdevPostButtonEvent(pInfo, button, 1);
|
||||
EvdevPostButtonEvent(pInfo, button, 0);
|
||||
EvdevQueueButtonEvent(pInfo, button, 1);
|
||||
EvdevQueueButtonEvent(pInfo, button, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,9 +507,9 @@ EvdevProcessButtonEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||
return;
|
||||
|
||||
if (button)
|
||||
EvdevPostButtonEvent(pInfo, button, value);
|
||||
EvdevQueueButtonEvent(pInfo, button, value);
|
||||
else
|
||||
EvdevPostKbdEvent(pInfo, ev, value);
|
||||
EvdevQueueKbdEvent(pInfo, ev, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,17 +529,17 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||
switch (ev->code) {
|
||||
case REL_WHEEL:
|
||||
if (value > 0)
|
||||
EvdevPostButtonClicks(pInfo, wheel_up_button, value);
|
||||
EvdevQueueButtonClicks(pInfo, wheel_up_button, value);
|
||||
else if (value < 0)
|
||||
EvdevPostButtonClicks(pInfo, wheel_down_button, -value);
|
||||
EvdevQueueButtonClicks(pInfo, wheel_down_button, -value);
|
||||
break;
|
||||
|
||||
case REL_DIAL:
|
||||
case REL_HWHEEL:
|
||||
if (value > 0)
|
||||
EvdevPostButtonClicks(pInfo, wheel_right_button, value);
|
||||
EvdevQueueButtonClicks(pInfo, wheel_right_button, value);
|
||||
else if (value < 0)
|
||||
EvdevPostButtonClicks(pInfo, wheel_left_button, -value);
|
||||
EvdevQueueButtonClicks(pInfo, wheel_left_button, -value);
|
||||
break;
|
||||
|
||||
/* We don't post wheel events as axis motion. */
|
||||
|
||||
@@ -181,9 +181,9 @@ typedef struct {
|
||||
} 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 EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
||||
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
||||
void EvdevQueueButtonClicks(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,
|
||||
|
||||
Reference in New Issue
Block a user