comparison src/video/directfb/SDL_DirectFB_mouse.c @ 2940:b93965a16fe0

Fixed X11 mouse motion/button events - it's not actually safe to cast mouse events to device events. Fixed building SDL without XInput support Simplified the process of registering a mouse device
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 07:59:08 +0000
parents 6ce28e5287e9
children d364ee9b9c15
comparison
equal deleted inserted replaced
2939:084e5b4fc5be 2940:b93965a16fe0
45 45
46 if ((desc.type & DIDTF_MOUSE) && (device_id & id_mask)) { 46 if ((desc.type & DIDTF_MOUSE) && (device_id & id_mask)) {
47 SDL_Mouse mouse; 47 SDL_Mouse mouse;
48 48
49 SDL_zero(mouse); 49 SDL_zero(mouse);
50 mouse.id = device_id;
50 mouse.CreateCursor = DirectFB_CreateCursor; 51 mouse.CreateCursor = DirectFB_CreateCursor;
51 mouse.ShowCursor = DirectFB_ShowCursor; 52 mouse.ShowCursor = DirectFB_ShowCursor;
52 mouse.MoveCursor = DirectFB_MoveCursor; 53 mouse.MoveCursor = DirectFB_MoveCursor;
53 mouse.FreeCursor = DirectFB_FreeCursor; 54 mouse.FreeCursor = DirectFB_FreeCursor;
54 mouse.WarpMouse = DirectFB_WarpMouse; 55 mouse.WarpMouse = DirectFB_WarpMouse;
55 mouse.FreeMouse = DirectFB_FreeMouse; 56 mouse.FreeMouse = DirectFB_FreeMouse;
56 mouse.cursor_shown = 1; 57 mouse.cursor_shown = 1;
57 58
58 SDL_SetMouseIndexId(device_id, devdata->num_mice); 59 SDL_AddMouse(&mouse, desc.name, 0, 0, 1);
59 SDL_AddMouse(&mouse, devdata->num_mice, desc.name, 0, 0, 1); 60 devdata->mouse_id[devdata->num_mice++] = device_id;
60 devdata->mouse_id[devdata->num_mice] = device_id;
61 devdata->num_mice++;
62 } 61 }
63 return DFENUM_OK; 62 return DFENUM_OK;
64 } 63 }
65 64
66 void 65 void
89 mouse.FreeCursor = DirectFB_FreeCursor; 88 mouse.FreeCursor = DirectFB_FreeCursor;
90 mouse.WarpMouse = DirectFB_WarpMouse; 89 mouse.WarpMouse = DirectFB_WarpMouse;
91 mouse.FreeMouse = DirectFB_FreeMouse; 90 mouse.FreeMouse = DirectFB_FreeMouse;
92 mouse.cursor_shown = 1; 91 mouse.cursor_shown = 1;
93 92
94 SDL_SetMouseIndexId(0, 0); /* ID == Index ! */ 93 SDL_AddMouse(&mouse, "Mouse", 0, 0, 1);
95 devdata->mouse_id[0] = 0;
96 SDL_AddMouse(&mouse, 0, "Mouse", 0, 0, 1);
97 devdata->num_mice = 1; 94 devdata->num_mice = 1;
98 } 95 }
99 } 96 }
100 97
101 void 98 void