Skip to content

Commit

Permalink
Use XInput device name for tabletModel. Fixes #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneA committed Jan 12, 2013
1 parent d08c9b3 commit 089ffd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/XInput.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
// Holds the values for the Wacom API.
xinput_values_t g_xinput_values = {
.isWacom = true,
.tabletModel = "Intuos 5", // FIXME
.tabletModelID = "Intuos 5",
};

// Holds XInput wrapper state.
Expand Down Expand Up @@ -66,7 +64,12 @@ static XDeviceInfo* xinput_findDeviceById(Display *display, int id)

for (int i = 0; i < num; i++) {
if (id == devices[i].id) {
// Fill tablet model here.
snprintf(g_xinput_values.tabletModel, sizeof(g_xinput_values.tabletModel), devices[i].name);
snprintf(g_xinput_values.tabletModelID, sizeof(g_xinput_values.tabletModelID), devices[i].name);

debug("Got %s, %i\n", devices[i].name, devices[i].type);

tablet = &devices[i];

XAnyClassPtr any = (XAnyClassPtr)tablet->inputclassinfo;
Expand Down
4 changes: 2 additions & 2 deletions src/XInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ typedef struct xinput_values_t {
float tiltY;
float tangentialPressure;
long pointerType;
char *tabletModel;
char *tabletModelID;
char tabletModel[256];
char tabletModelID[256];
} xinput_values_t;

// Any other global XInput wrapper state.
Expand Down

0 comments on commit 089ffd2

Please sign in to comment.