Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Proximity events, Pressure detection for multiple windows. Tablet but…
Browse files Browse the repository at this point in the history
…ton detection on the way.
  • Loading branch information
Szymon Wilczek committed Jul 23, 2008
1 parent a6ec94a commit e5cf7e6
Show file tree
Hide file tree
Showing 6 changed files with 1,249 additions and 1,149 deletions.
21 changes: 11 additions & 10 deletions src/events/SDL_mouse.c
Expand Up @@ -28,12 +28,12 @@
#include "default_cursor.h"


static int SDL_num_mice;
static int SDL_current_mouse;
static SDL_Mouse **SDL_mice;
int *SDL_IdIndex;
int SDL_highestId;
int last_x, last_y;
static int SDL_num_mice=0;
static int SDL_current_mouse=-1;
static SDL_Mouse **SDL_mice=NULL;
static int *SDL_IdIndex=NULL;
static int SDL_highestId=-1;
static int last_x, last_y;
int x_max, y_max;
/* Public functions */
int
Expand All @@ -56,7 +56,7 @@ SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,int
{
SDL_Mouse **mice;
int selected_mouse;
char* temp_name;
//char* temp_name;
/* Add the mouse to the list of mice */
if (index < 0 || index >= SDL_num_mice || SDL_mice[index]) {
mice =
Expand All @@ -76,8 +76,8 @@ SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,int
return -1;
}
*SDL_mice[index] = *mouse;
SDL_mice[index]->name=SDL_malloc(strlen(name)*sizeof(char));
strcpy(SDL_mice[index]->name,name);
SDL_mice[index]->name=SDL_malloc(SDL_strlen(name)*sizeof(char));
SDL_strlcpy(SDL_mice[index]->name,name,255);
SDL_mice[index]->pressure_max=pressure_max;
SDL_mice[index]->pressure_min=pressure_min;
SDL_mice[index]->cursor_shown = SDL_TRUE;
Expand Down Expand Up @@ -721,7 +721,7 @@ SDL_ShowCursor(int toggle)
return shown;
}

void SDL_SetIndexId(int id, int index)
int SDL_SetIndexId(int id, int index)
{
if(id>SDL_highestId)
{
Expand All @@ -741,6 +741,7 @@ void SDL_SetIndexId(int id, int index)
{
SDL_IdIndex[id]=index;
}
return 1;
}

int SDL_GetIndexById(int id)
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_mouse_c.h
Expand Up @@ -118,7 +118,7 @@ extern void SDL_MouseQuit(void);

extern int SDL_GetIndexById(int id);

extern void SDL_SetIndexId(int id, int index);
extern int SDL_SetIndexId(int id, int index);

extern int SDL_GetNumOfMice(void);

Expand Down

0 comments on commit e5cf7e6

Please sign in to comment.