Xvfb: Support up to 13 mouse buttons
Signed-off-by: Luke Dashjr <luke-jr+git@utopios.org>
This commit is contained in:
parent
7fdef970c4
commit
5f48efa2bd
|
@ -81,7 +81,7 @@ vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
|
||||||
static int
|
static int
|
||||||
vfbMouseProc(DeviceIntPtr pDevice, int onoff)
|
vfbMouseProc(DeviceIntPtr pDevice, int onoff)
|
||||||
{
|
{
|
||||||
#define NBUTTONS 3
|
#define NBUTTONS 13
|
||||||
#define NAXES 2
|
#define NAXES 2
|
||||||
|
|
||||||
BYTE map[NBUTTONS + 1];
|
BYTE map[NBUTTONS + 1];
|
||||||
|
@ -91,13 +91,23 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff)
|
||||||
|
|
||||||
switch (onoff) {
|
switch (onoff) {
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
map[1] = 1;
|
for (int i = 1; i <= NBUTTONS; ++i) {
|
||||||
map[2] = 2;
|
map[i] = i;
|
||||||
map[3] = 3;
|
}
|
||||||
|
|
||||||
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
||||||
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
||||||
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
||||||
|
btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
|
||||||
|
btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
|
||||||
|
btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
|
||||||
|
btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
|
||||||
|
btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
btn_labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
btn_labels[9] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
btn_labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
btn_labels[11] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
btn_labels[12] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
|
||||||
|
|
||||||
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
||||||
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
||||||
|
|
Loading…
Reference in New Issue