From 0a29eddd798e0722b74d0653fcd293b977cb5704 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 31 Aug 2006 18:13:40 +0000 Subject: Add key and mouse input widgets for selecting keys and mouse buttons. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 583 --- setup/mouse.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'setup/mouse.c') diff --git a/setup/mouse.c b/setup/mouse.c index f87eb390..e60868fc 100644 --- a/setup/mouse.c +++ b/setup/mouse.c @@ -2,11 +2,50 @@ #include #include "textscreen.h" +#include "txt_mouseinput.h" + int novert; int speed; int accel; int threshold; +int mouseb_fire; +int mouseb_strafe; +int mouseb_forward; + +static int *all_mouse_buttons[] = {&mouseb_fire, &mouseb_strafe, + &mouseb_forward}; + +static void MouseSetCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(variable)) +{ + TXT_CAST_ARG(int, variable); + int i; + + // Check if the same mouse button is used for a different action + // If so, set the other action(s) to -1 (unset) + + for (i=0; i