Drop valuator mask argument from GetKeyboardEvents

Nothing was using it and if anyone had they would've gotten a warning and
noticed that it doesn't actually work. Drop this, it has been unused for years.

Input ABI 22

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Peter Hutterer 2014-12-16 14:43:29 +10:00
parent 9d9bd38fe1
commit f485a1af64
14 changed files with 31 additions and 107 deletions

View File

@ -421,7 +421,7 @@ ProcXTestFakeInput(ClientPtr client)
case KeyPress: case KeyPress:
case KeyRelease: case KeyRelease:
nevents = nevents =
GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail, NULL); GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail);
break; break;
} }

View File

@ -2518,7 +2518,7 @@ ReleaseButtonsAndKeys(DeviceIntPtr dev)
/* Release all keys */ /* Release all keys */
for (i = 0; k && i < MAP_LENGTH; i++) { for (i = 0; k && i < MAP_LENGTH; i++) {
if (BitIsOn(k->down, i)) { if (BitIsOn(k->down, i)) {
nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i, NULL); nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i);
for (j = 0; j < nevents; j++) for (j = 0; j < nevents; j++)
mieqProcessDeviceEvent(dev, &eventlist[j], NULL); mieqProcessDeviceEvent(dev, &eventlist[j], NULL);
} }

View File

@ -1049,21 +1049,18 @@ event_set_root_coordinates(DeviceEvent *event, double x, double y)
* *
* This function is not reentrant. Disable signals before calling. * This function is not reentrant. Disable signals before calling.
* *
* FIXME: flags for relative/abs motion?
*
* @param device The device to generate the event for * @param device The device to generate the event for
* @param type Event type, one of KeyPress or KeyRelease * @param type Event type, one of KeyPress or KeyRelease
* @param keycode Key code of the pressed/released key * @param keycode Key code of the pressed/released key
* @param mask Valuator mask for valuators present for this event.
* *
*/ */
void void
QueueKeyboardEvents(DeviceIntPtr device, int type, QueueKeyboardEvents(DeviceIntPtr device, int type,
int keycode, const ValuatorMask *mask) int keycode)
{ {
int nevents; int nevents;
nevents = GetKeyboardEvents(InputEventList, device, type, keycode, mask); nevents = GetKeyboardEvents(InputEventList, device, type, keycode);
queueEventList(device, InputEventList, nevents); queueEventList(device, InputEventList, nevents);
} }
@ -1078,20 +1075,17 @@ QueueKeyboardEvents(DeviceIntPtr device, int type,
*/ */
int int
GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
int key_code, const ValuatorMask *mask_in) int key_code)
{ {
int num_events = 0; int num_events = 0;
CARD32 ms = 0; CARD32 ms = 0;
DeviceEvent *event; DeviceEvent *event;
RawDeviceEvent *raw; RawDeviceEvent *raw;
ValuatorMask mask;
#if XSERVER_DTRACE #if XSERVER_DTRACE
if (XSERVER_INPUT_EVENT_ENABLED()) { if (XSERVER_INPUT_EVENT_ENABLED()) {
XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0, XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0, 0,
mask_in ? mask_in->last_bit + 1 : 0, NULL, NULL);
mask_in ? mask_in->mask : NULL,
mask_in ? mask_in->valuators : NULL);
} }
#endif #endif
@ -1104,11 +1098,6 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
(key_code < 8 || key_code > 255)) (key_code < 8 || key_code > 255))
return 0; return 0;
if (mask_in && valuator_mask_size(mask_in) > 1) {
ErrorF("[dix] the server does not handle valuator masks with "
"keyboard events. This is a bug. You may fix it.\n");
}
num_events = 1; num_events = 1;
events = events =
@ -1130,14 +1119,7 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
events++; events++;
num_events++; num_events++;
valuator_mask_copy(&mask, mask_in);
init_raw(pDev, raw, ms, type, key_code); init_raw(pDev, raw, ms, type, key_code);
set_raw_valuators(raw, &mask, raw->valuators.data_raw);
clipValuators(pDev, &mask);
set_raw_valuators(raw, &mask, raw->valuators.data);
event = &events->device_event; event = &events->device_event;
init_device_event(event, pDev, ms); init_device_event(event, pDev, ms);
@ -1152,18 +1134,6 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
set_key_up(pDev, key_code, KEY_POSTED); set_key_up(pDev, key_code, KEY_POSTED);
} }
clipValuators(pDev, &mask);
set_valuators(pDev, event, &mask);
if (!IsFloating(pDev)) {
DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
event_set_root_coordinates(event,
master->last.valuators[0],
master->last.valuators[1]);
}
return num_events; return num_events;
} }

View File

@ -488,12 +488,9 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
switch (type) { switch (type) {
case XI_DeviceKeyPress: case XI_DeviceKeyPress:
case XI_DeviceKeyRelease: case XI_DeviceKeyRelease:
EXTRACT_VALUATORS(ke, valuators);
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
valuators);
if (block) if (block)
OsBlockSIGIO(); OsBlockSIGIO();
QueueKeyboardEvents(pDevice, event, ke->keycode, &mask); QueueKeyboardEvents(pDevice, event, ke->keycode);
if (block) if (block)
OsReleaseSIGIO(); OsReleaseSIGIO();
break; break;
@ -718,7 +715,7 @@ dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
detail = dmxFixup(pDev, detail, keySym); detail = dmxFixup(pDev, detail, keySym);
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym); */ /*ErrorF("KEY %d sym %d\n", detail, (int) keySym); */
QueueKeyboardEvents(p, type, detail, NULL); QueueKeyboardEvents(p, type, detail);
return; return;
case ButtonPress: case ButtonPress:

View File

@ -1831,7 +1831,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki,
else else
type = KeyPress; type = KeyPress;
QueueKeyboardEvents(ki->dixdev, type, key_code, NULL); QueueKeyboardEvents(ki->dixdev, type, key_code);
} }
else { else {
ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n",

View File

@ -403,7 +403,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
i < keyc->xkbInfo->desc->max_key_code; i++) { i < keyc->xkbInfo->desc->max_key_code; i++) {
if (key_is_down(pDev, i, KEY_POSTED)) { if (key_is_down(pDev, i, KEY_POSTED)) {
OsBlockSIGIO(); OsBlockSIGIO();
QueueKeyboardEvents(pDev, KeyRelease, i, NULL); QueueKeyboardEvents(pDev, KeyRelease, i);
OsReleaseSIGIO(); OsReleaseSIGIO();
} }
} }

View File

@ -81,7 +81,7 @@ typedef enum {
*/ */
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(22, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)

View File

@ -1326,47 +1326,21 @@ xf86PostButtonEventM(DeviceIntPtr device,
} }
void void
xf86PostKeyEvent(DeviceIntPtr device, xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down)
unsigned int key_code,
int is_down,
int is_absolute, int first_valuator, int num_valuators, ...)
{ {
va_list var; xf86PostKeyEventM(device, key_code, is_down);
int i = 0;
ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
valuator_mask_zero(&mask);
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
} }
void void
xf86PostKeyEventP(DeviceIntPtr device, xf86PostKeyEventP(DeviceIntPtr device,
unsigned int key_code, unsigned int key_code,
int is_down, int is_down)
int is_absolute,
int first_valuator, int num_valuators, const int *valuators)
{ {
ValuatorMask mask; xf86PostKeyEventM(device, key_code, is_down);
XI_VERIFY_VALUATORS(num_valuators);
valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
} }
void void
xf86PostKeyEventM(DeviceIntPtr device, xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down)
unsigned int key_code,
int is_down, int is_absolute, const ValuatorMask *mask)
{ {
#if XFreeXDGA #if XFreeXDGA
DeviceIntPtr pointer; DeviceIntPtr pointer;
@ -1382,8 +1356,7 @@ xf86PostKeyEventM(DeviceIntPtr device,
} }
#endif #endif
QueueKeyboardEvents(device, QueueKeyboardEvents(device, is_down ? KeyPress : KeyRelease, key_code);
is_down ? KeyPress : KeyRelease, key_code, mask);
} }
void void
@ -1392,7 +1365,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down)
ValuatorMask mask; ValuatorMask mask;
valuator_mask_zero(&mask); valuator_mask_zero(&mask);
xf86PostKeyEventM(device, key_code, is_down, 0, &mask); xf86PostKeyEventM(device, key_code, is_down);
} }
InputInfoPtr InputInfoPtr

View File

@ -148,18 +148,11 @@ extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute,
int button, int is_down, int button, int is_down,
const ValuatorMask *mask); const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device,
unsigned int key_code, int is_down, unsigned int key_code, int is_down);
int is_absolute, int first_valuator,
int num_valuators, ...);
extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device, extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device,
unsigned int key_code, int is_down, unsigned int key_code, int is_down);
int is_absolute,
const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device,
unsigned int key_code, int is_down, unsigned int key_code, int is_down);
int is_absolute, int first_valuator,
int num_valuators,
const int *valuators);
extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device,
unsigned int key_code, int is_down); unsigned int key_code, int is_down);
extern _X_EXPORT void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid, extern _X_EXPORT void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid,

View File

@ -103,7 +103,7 @@ void
xnestQueueKeyEvent(int type, unsigned int keycode) xnestQueueKeyEvent(int type, unsigned int keycode)
{ {
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL); QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
} }
void void

View File

@ -456,8 +456,7 @@ DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev)
if (pDev->key) { if (pDev->key) {
for (i = 0; i < NUM_KEYCODES; i++) { for (i = 0; i < NUM_KEYCODES; i++) {
if (BitIsOn(pDev->key->down, i + MIN_KEYCODE)) { if (BitIsOn(pDev->key->down, i + MIN_KEYCODE)) {
QueueKeyboardEvents(pDev, KeyRelease, i + MIN_KEYCODE, QueueKeyboardEvents(pDev, KeyRelease, i + MIN_KEYCODE);
NULL);
} }
} }
} }
@ -611,8 +610,7 @@ DarwinSendKeyboardEvents(int ev_type, int keycode)
darwinEvents_lock(); darwinEvents_lock();
{ {
QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE, QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
NULL);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }

View File

@ -323,7 +323,6 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial,
{ {
struct xwl_seat *xwl_seat = data; struct xwl_seat *xwl_seat = data;
uint32_t *k, *end; uint32_t *k, *end;
ValuatorMask mask;
xwl_seat->xwl_screen->serial = serial; xwl_seat->xwl_screen->serial = serial;
@ -338,9 +337,8 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial,
*k = key; *k = key;
} }
valuator_mask_zero(&mask);
QueueKeyboardEvents(xwl_seat->keyboard, QueueKeyboardEvents(xwl_seat->keyboard,
state ? KeyPress : KeyRelease, key + 8, &mask); state ? KeyPress : KeyRelease, key + 8);
} }
static void static void
@ -393,16 +391,14 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard,
struct wl_surface *surface, struct wl_array *keys) struct wl_surface *surface, struct wl_array *keys)
{ {
struct xwl_seat *xwl_seat = data; struct xwl_seat *xwl_seat = data;
ValuatorMask mask;
uint32_t *k; uint32_t *k;
xwl_seat->xwl_screen->serial = serial; xwl_seat->xwl_screen->serial = serial;
xwl_seat->keyboard_focus = surface; xwl_seat->keyboard_focus = surface;
wl_array_copy(&xwl_seat->keys, keys); wl_array_copy(&xwl_seat->keys, keys);
valuator_mask_zero(&mask);
wl_array_for_each(k, &xwl_seat->keys) wl_array_for_each(k, &xwl_seat->keys)
QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8, &mask); QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8);
} }
static void static void
@ -410,14 +406,12 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard,
uint32_t serial, struct wl_surface *surface) uint32_t serial, struct wl_surface *surface)
{ {
struct xwl_seat *xwl_seat = data; struct xwl_seat *xwl_seat = data;
ValuatorMask mask;
uint32_t *k; uint32_t *k;
xwl_seat->xwl_screen->serial = serial; xwl_seat->xwl_screen->serial = serial;
valuator_mask_zero(&mask);
wl_array_for_each(k, &xwl_seat->keys) wl_array_for_each(k, &xwl_seat->keys)
QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8, &mask); QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8);
xwl_seat->keyboard_focus = NULL; xwl_seat->keyboard_focus = NULL;
} }

View File

@ -502,7 +502,7 @@ winSendKeyEvent(DWORD dwKey, Bool fDown)
g_winKeyState[dwKey] = fDown; g_winKeyState[dwKey] = fDown;
QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease,
dwKey + MIN_KEYCODE, NULL); dwKey + MIN_KEYCODE);
winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown); winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown);
} }

View File

@ -448,12 +448,11 @@ extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events, extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
DeviceIntPtr pDev, DeviceIntPtr pDev,
int type, int type,
int key_code, const ValuatorMask *mask); int key_code);
extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev, extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
int type, int type,
int key_code, int key_code);
const ValuatorMask *mask);
extern int GetTouchEvents(InternalEvent *events, extern int GetTouchEvents(InternalEvent *events,
DeviceIntPtr pDev, DeviceIntPtr pDev,