From 0855a6be4c96b0f91c3687a82cb1bd30688520c4 Mon Sep 17 00:00:00 2001 From: Christoph Frick Date: Mon, 15 Jan 2007 12:08:00 +0100 Subject: [PATCH] dinput: Move the config for the buttons from the JoyDev into the JoystickImpl. --- dlls/dinput/joystick_linuxinput.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index efdb040a4c..090842474b 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -111,8 +111,6 @@ struct JoyDev { /* data returned by the EVIOCGABS() ioctl */ int axes[ABS_MAX][5]; - /* LUT for KEY_ to offset in rgbButtons */ - BYTE buttons[KEY_MAX]; }; struct ObjProps @@ -142,6 +140,9 @@ struct JoystickImpl struct ObjProps props[ABS_MAX]; + /* LUT for KEY_ to offset in rgbButtons */ + BYTE buttons[KEY_MAX]; + /* Force feedback variables */ EffectListItem* top_effect; int ff_state; @@ -181,7 +182,7 @@ static void find_joydevs(void) struct JoyDev joydev = {0}; int fd; int no_ff_check = 0; - int j, buttons; + int j; snprintf(buf,MAX_PATH,EVDEVPREFIX"%d",i); buf[MAX_PATH-1] = 0; @@ -262,15 +263,6 @@ static void find_joydevs(void) } } - buttons = 0; - for (j=0;jjoydev->keybits, i)) continue; memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[btn + WINE_JOYSTICK_BUTTON_BASE], df->dwObjSize); + newDevice->buttons[i] = 0x80 | btn; df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(btn++) | DIDFT_PSHBUTTON; } df->dwNumObjs = idx; @@ -723,7 +716,7 @@ static void joy_polldev(JoystickImpl *This) switch (ie.type) { case EV_KEY: /* button */ { - int btn = This->joydev->buttons[ie.code]; + int btn = This->buttons[ie.code]; TRACE("(%p) %d -> %d\n", This, ie.code, btn); if (btn & 0x80) -- 2.32.0.93.g670b81a890