Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11mouse.c @ 3766:24db5d326f57 gsoc2008_manymouse
Pressure levels. Documentation http://wilku.ravenlord.ws/doku.php?id=documentation
author | Szymon Wilczek <kazeuser@gmail.com> |
---|---|
date | Sun, 06 Jul 2008 09:24:56 +0000 |
parents | e0c95ad1ba87 |
children | 9087a84cba51 |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11mouse.c Sat Jul 05 20:02:07 2008 +0000 +++ b/src/video/x11/SDL_x11mouse.c Sun Jul 06 09:24:56 2008 +0000 @@ -47,6 +47,7 @@ { if(deviceClass->class==ValuatorClass) { + XValuatorInfo* valInfo; newDevices= (XDevice**) SDL_realloc(SDL_XDevices, (index+1)*sizeof(*newDevices)); if(!newDevices) { @@ -58,7 +59,15 @@ SDL_Mouse mouse; SDL_zero(mouse); SDL_SetIndexId(DevList[i].id,index); - data->mouse = SDL_AddMouse(&mouse, index++,DevList[i].name); + valInfo=(XValuatorInfo*)deviceClass; + if(valInfo->num_axes>2) + { + data->mouse = SDL_AddMouse(&mouse, index++,DevList[i].name,valInfo->axes[2].max_value,valInfo->axes[2].min_value); + } + else + { + data->mouse = SDL_AddMouse(&mouse, index++,DevList[i].name,0,0); + } break; } deviceClass=(XAnyClassPtr)((char*)deviceClass + deviceClass->length);