* graphire 4 currently sends the events on buttons 9 and 13
authorAristeu Rozanski <arozansk@redhat.com>
Tue, 30 Sep 2008 21:36:40 +0000 (17:36 -0400)
committerAristeu Rozanski <arozansk@redhat.com>
Tue, 30 Sep 2008 21:36:40 +0000 (17:36 -0400)
src-expresskeys/config_read.c
src-expresskeys/config_write.c
src-expresskeys/tablet.c

index 6ddbb43..40c2000 100644 (file)
@@ -533,8 +533,8 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                }
        }
 /* ButtonRepeatAfter DelayButtonRepeat
- LeftPadButton9/LeftButton LeftPadButton10/RightButton
- RepeatButton9/RepeatLeft RepeatButton10/RepeatRight */
+ LeftPadButton9/LeftButton
+ RepeatButton9/RepeatLeft */
        if (model == i3s || model == i3 || model == g4 || model == g4b ||
                                                          model == bee) {
                if (((field = (strstr(read_buffer, bsp->repeat_after)))!= NULL)
@@ -558,18 +558,21 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        transfer_keycode(bdp->button9, write_buffer);
                        return;
                }
-               if (((field = (strstr(read_buffer, bsp->button10))) != NULL)
+               if (((field = (strstr(read_buffer, bsp->repeat9))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
                        prune_field(field, write_buffer);
-                       transfer_keycode(bdp->button10, write_buffer);
+                       transfer_boolean(bdp->repeat9, write_buffer);
                        return;
                }
-               if (((field = (strstr(read_buffer, bsp->repeat9))) != NULL)
+       }
+/* LeftPadButton10/RightButton RepeatButton10/RepeatRight */
+       if (model == i3s || model == i3 || model == g4b || model == bee) {
+               if (((field = (strstr(read_buffer, bsp->button10))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
                        prune_field(field, write_buffer);
-                       transfer_boolean(bdp->repeat9, write_buffer);
+                       transfer_keycode(bdp->button10, write_buffer);
                        return;
                }
                if (((field = (strstr(read_buffer, bsp->repeat10))) != NULL)
@@ -580,6 +583,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        return;
                }
        }
+
 /* LeftPadButton11 LeftPadButton12 RepeatButton11 RepeatButton12 */
        if (model == i3s || model == i3 || model == bee) {
                if (((field = (strstr(read_buffer, bsp->button11))) != NULL)
@@ -611,6 +615,24 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        return;
                }
        }
+/* RightPadButton13 RepeatButton13 */
+       if (model == i3 || model == g4 || model == bee) {
+               if (((field = (strstr(read_buffer, bsp->button13))) != NULL)
+                       && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                               || (field < comment))) {
+                       prune_field(field, write_buffer);
+                       transfer_keycode(bdp->button13, write_buffer);
+                       return;
+               }
+               if (((field = (strstr(read_buffer, bsp->repeat13))) != NULL)
+                       && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                               || (field < comment))) {
+                       prune_field(field, write_buffer);
+                       transfer_boolean(bdp->repeat13, write_buffer);
+                       return;
+               }
+       }
+
 /* RightPadTouchUp RightPadTouchDown RepeatRightUp RepeatRightDown
  RightPadButton13 RightPadButton14 RightPadButton15 RightPadButton16
  RepeatButton13 RepeatButton14 RepeatButton15 RepeatButton16 */
@@ -647,13 +669,6 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        transfer_boolean(tdp->repeat_right_down, write_buffer);
                        return;
                }
-               if (((field = (strstr(read_buffer, bsp->button13))) != NULL)
-                       && (((comment = (strchr(read_buffer, '#'))) == NULL)
-                                               || (field < comment))) {
-                       prune_field(field, write_buffer);
-                       transfer_keycode(bdp->button13, write_buffer);
-                       return;
-               }
                if (((field = (strstr(read_buffer, bsp->button14))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -675,13 +690,6 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        transfer_keycode(bdp->button16, write_buffer);
                        return;
                }
-               if (((field = (strstr(read_buffer, bsp->repeat13))) != NULL)
-                       && (((comment = (strchr(read_buffer, '#'))) == NULL)
-                                               || (field < comment))) {
-                       prune_field(field, write_buffer);
-                       transfer_boolean(bdp->repeat13, write_buffer);
-                       return;
-               }
                if (((field = (strstr(read_buffer, bsp->repeat14))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
index 74bcf53..622e700 100644 (file)
@@ -508,13 +508,13 @@ static void write_g4(FILE* fp)
                sp->button_string.button9, *ip->button_data.button9,
                                *(ip->button_data.button9+1), key_tail,MAXKEYS);
                fprintf(fp, "%s         %i %i   %s %i)\n\n",
-               sp->button_string.button10, *ip->button_data.button10,
-                               *(ip->button_data.button10+1),key_tail,MAXKEYS);
+               sp->button_string.button13, *ip->button_data.button13,
+                               *(ip->button_data.button13+1),key_tail,MAXKEYS);
 
                fprintf(fp, "%s         %i      %s\n",
                sp->button_string.repeat9, *ip->button_data.repeat9, but_tail);
                fprintf(fp, "%s         %i      %s\n\n",
-               sp->button_string.repeat10, *ip->button_data.repeat10,but_tail);
+               sp->button_string.repeat13, *ip->button_data.repeat13,but_tail);
 
        }
 
index 24791ae..eb8e5de 100644 (file)
@@ -268,9 +268,9 @@ struct g4_program g4_internal_list[] = {
                .repeat_after = { 0, 5 },
                .repeat_delay = { 0, 1 },
                .button9 = { 0, 5 },
-               .button10 = { 0, 1 },
                .button11 = { 50, 0 },
                .button12 = { 64, 0 },
+               .button13 = { 0, 1 },
                },
        },
        {
@@ -288,7 +288,7 @@ struct g4_program g4_internal_list[] = {
                .repeat_after = { 0, 5 },
                .repeat_delay = { 0, 1 },
                .button9 = { 37, 29 },
-               .button10 = { 37, 52 },
+               .button13 = { 37, 52 },
                },
        },
        {
@@ -306,7 +306,7 @@ struct g4_program g4_internal_list[] = {
                .repeat_after = { 0, 5 },
                .repeat_delay = { 0, 1 },
                .button9 = { 37, 29 },
-               .button10 = { 37, 52 },
+               .button13 = { 37, 52 },
                },
        },
        {
@@ -318,7 +318,8 @@ struct g4_program g4_internal_list[] = {
        .button_data = {
                .repeat_after = { 0, 5 },
                .repeat_delay = { 0, 1 },
-               .button10 = { 999, 0 },
+               .button9 = { 999, 0 },
+               .button13 = { 999, 0 },
                },
        },
 };
@@ -333,8 +334,8 @@ struct g4_configstrings g4_configstrings[] = {
 {{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
 {"HandleScrollWheel", "ScrollWheelUp", "ScrollWheelDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
-"RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
-"LeftButton", "RightButton"}}
+"RepeatLeft", NULL, NULL, NULL, "RepeatRight", NULL, NULL, NULL, NULL, NULL,
+"LeftButton", NULL, NULL, NULL, "RightButton"}}
 };
 
 struct g4b_program g4b_internal_list[] = {