Add mouse controls
This commit is contained in:
parent
20599f5946
commit
fb8b25bc86
@ -179,6 +179,28 @@ int XNextEvent(Display *display, XEvent *event_return)
|
|||||||
setAnalogue(ANALOGUE_2, ((double)event_return->xmotion.y / (double)getConfig()->height) * 255.0);
|
setAnalogue(ANALOGUE_2, ((double)event_return->xmotion.y / (double)getConfig()->height) * 255.0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ButtonPress:
|
||||||
|
case ButtonRelease:
|
||||||
|
{
|
||||||
|
printf("%d %d %d\n", event_return->xbutton.button, event_return->xbutton.x, event_return->xbutton.y);
|
||||||
|
|
||||||
|
switch (event_return->xbutton.button)
|
||||||
|
{
|
||||||
|
case 1: // Trigger
|
||||||
|
setSwitch(PLAYER_1, BUTTON_1, event_return->type == ButtonPress);
|
||||||
|
break;
|
||||||
|
case 3: // Reload
|
||||||
|
setSwitch(PLAYER_1, BUTTON_2, event_return->type == ButtonPress);
|
||||||
|
break;
|
||||||
|
case 9: // Gun Button
|
||||||
|
setSwitch(PLAYER_1, BUTTON_3, event_return->type == ButtonPress);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue;
|
return returnValue;
|
||||||
|
Loading…
Reference in New Issue
Block a user