add support for Cintiq 21UX2
authorAristeu Rozanski <arozansk@redhat.com>
Tue, 12 Oct 2010 21:01:43 +0000 (17:01 -0400)
committerAristeu Rozanski <arozansk@redhat.com>
Tue, 12 Oct 2010 21:01:43 +0000 (17:01 -0400)
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
src-expresskeys/config_read.c
src-expresskeys/config_write.c
src-expresskeys/defines.h
src-expresskeys/event_loop.c
src-expresskeys/get_device.c
src-expresskeys/mark_info.c
src-expresskeys/on_signal.c
src-expresskeys/tablet.c
src-expresskeys/tablet.h

index fd24144..f4a63c3 100644 (file)
@@ -43,6 +43,7 @@ static int st2_prcurve_malloced;
 extern int be_verbose;
 extern int reread_config;
 
+extern const int ux2;
 extern const int bbo;
 extern const int bee;
 extern const int i3;
@@ -302,6 +303,7 @@ static void prune_field(char* field_begin, char* write_buffer)
 static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                                                                const int model)
 {
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -313,6 +315,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        struct touch_data* tdp = NULL;
        struct wheel_data* wdp = NULL;
        struct button_data* bdp = NULL;
+       struct ux2_configstrings* cux2;
        struct bbo_configstrings* cbbo;
        struct bee_configstrings* cbee;
        struct i3_configstrings* ci3;
@@ -325,7 +328,16 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        struct wheel_string* wsp = NULL;
        struct button_string* bsp = NULL;
 
-       if (model == bbo) {
+       if (model == ux2) {
+               pux2 = address;
+               cdp = &pux2->common_data;
+               tdp = &pux2->touch_data;
+               bdp = &pux2->button_data;
+               cux2 = ux2_configstrings;
+               csp = &cux2->common_string;
+               tsp = &cux2->touch_string;
+               bsp = &cux2->button_string;
+       } else if (model == bbo) {
                pbbo = address;
                cdp = &pbbo->common_data;
                wdp = &pbbo->wheel_data;
@@ -465,7 +477,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        }
 /* HandleTouchStrips TouchRepeatAfter DelayTouchRepeat
  LeftPadTouchUp LeftPadTouchDown RepeatLeftUp RepeatLeftDown */
-       if (model == i3s || model == i3 || model == bee || model == bbo) {
+       if (model == i3s || model == i3 || model == bee || model == ux2 || model == bbo) {
                if (((field = (strstr(read_buffer, tsp->handle_touch))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -546,11 +558,46 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        return;
                }
        }
+       if (model == ux2) {
+#define READ_BUTTON(x) \
+               if (((field = (strstr(read_buffer, bsp->button##x))) != NULL) \
+                       && (((comment = (strchr(read_buffer, '#'))) == NULL) \
+                                               || (field < comment))) { \
+                       prune_field(field, write_buffer); \
+                       transfer_keycode(bdp->button##x, write_buffer); \
+                       return; \
+               } \
+               if (((field = (strstr(read_buffer, bsp->repeat##x))) != NULL) \
+                       && (((comment = (strchr(read_buffer, '#'))) == NULL) \
+                                               || (field < comment))) { \
+                       prune_field(field, write_buffer); \
+                       transfer_boolean(bdp->repeat##x, write_buffer); \
+                       return; \
+               }
+               READ_BUTTON(1);
+               READ_BUTTON(2);
+               READ_BUTTON(3);
+               READ_BUTTON(4);
+               READ_BUTTON(5);
+               READ_BUTTON(6);
+               READ_BUTTON(7);
+               READ_BUTTON(8);
+               READ_BUTTON(9);
+               READ_BUTTON(10);
+               READ_BUTTON(11);
+               READ_BUTTON(12);
+               READ_BUTTON(13);
+               READ_BUTTON(14);
+               READ_BUTTON(15);
+               READ_BUTTON(16);
+               READ_BUTTON(17);
+               READ_BUTTON(18);
+       }
 /* ButtonRepeatAfter DelayButtonRepeat
  LeftPadButton9/LeftButton
  RepeatButton9/RepeatLeft */
        if (model == i3s || model == i3 || model == g4 || model == g4b ||
-                                         model == bbo || model == bee) {
+                                         model == bbo || model == bee) {
                if (((field = (strstr(read_buffer, bsp->repeat_after)))!= NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -782,6 +829,7 @@ static void read_body(FILE* errorfp, void* address, const int model,
        st1_prcurve_malloced = 0;
        st2_prcurve_malloced = 0;
 
+       struct ux2_program* pux2 = NULL;
        struct bbo_program* pbbo = NULL;
        struct bee_program* pbee = NULL;
        struct i3_program* pi3 = NULL;
@@ -789,6 +837,7 @@ static void read_body(FILE* errorfp, void* address, const int model,
        struct g4_program* pg4 = NULL;
        struct g4b_program* pg4b = NULL;
        struct nop_program* pnop = NULL;
+       struct ux2_program* pux2_base = NULL;
        struct bbo_program* pbbo_base = NULL;
        struct bee_program* pbee_base = NULL;
        struct i3_program* pi3_base = NULL;
@@ -797,7 +846,14 @@ static void read_body(FILE* errorfp, void* address, const int model,
        struct g4b_program* pg4b_base = NULL;
        struct nop_program* pnop_base = NULL;
 
-       if (model == bbo) {
+       if (model == ux2) {
+               pux2 = address;
+               pux2_base = pux2;
+               if (reread_config) {
+                       pux2->default_program = NULL;
+                       pux2->common_data.num_record = 0;
+               }
+       } else if (model == bbo) {
                pbbo = address;
                pbbo_base = pbbo;
                if (reread_config) {
@@ -931,7 +987,9 @@ static void read_body(FILE* errorfp, void* address, const int model,
                                continue;
                        }
 
-                       if (pbbo) {
+                       if (pux2) {
+                               handle_field(errorfp, read_buffer, pux2, model);
+                       } else if (pbbo) {
                                handle_field(errorfp, read_buffer, pbbo, model);
                        } else if (pbee) {
                                handle_field(errorfp, read_buffer, pbee, model);
@@ -950,7 +1008,42 @@ static void read_body(FILE* errorfp, void* address, const int model,
 
 /* End field loop*/
 
-               if (pbbo) {
+               if (pux2) {
+                       if (pux2->common_data.class_name == NULL) {
+                               revert_config = 1;
+                               if (pux2->common_data.stylus1_presscurve
+                                                               != NULL) {
+                               free(pux2->common_data.stylus1_presscurve);
+                               st1_prcurve_malloced = 0;
+                               pux2->common_data.stylus1_presscurve = NULL;
+                               }
+                               if (pux2->common_data.stylus2_presscurve
+                                                               != NULL) {
+                               free(pux2->common_data.stylus2_presscurve);
+                               st2_prcurve_malloced = 0;
+                               pux2->common_data.stylus2_presscurve = NULL;
+                               }
+                       }
+                       if ((pux2->common_data.class_name != NULL)
+                               && (strcmp(pux2->common_data.class_name,
+                                                       def_rec) == 0)) {
+                               pux2_base->default_program = pux2;
+                       }
+                       if (pux2->common_data.class_name != NULL) {
+                               pgr_recname_malloced = 0;
+                               revert_config = 0;
+                               num_record++;
+                               if (pux2->common_data.stylus1_presscurve
+                                                               != NULL) {
+                                       st1_prcurve_malloced = 0;
+                               }
+                               if (pux2->common_data.stylus2_presscurve
+                                                               != NULL) {
+                                       st2_prcurve_malloced = 0;
+                               }
+                               pux2++;
+                       }
+               } if (pbbo) {
                        if (pbbo->common_data.class_name == NULL) {
                                revert_config = 1;
                                if (pbbo->common_data.stylus1_presscurve
@@ -1202,7 +1295,13 @@ static void read_body(FILE* errorfp, void* address, const int model,
 
        fclose(fp);
 
-       if (model == bbo) {
+       if (model == ux2) {
+               pux2 = address;
+               if (pux2->default_program == NULL) {
+                       no_default = 1;
+               }
+               pux2->common_data.num_record = num_record;
+       } else if (model == bbo) {
                pbbo = address;
                if (pbbo->default_program == NULL) {
                        no_default = 1;
@@ -1375,6 +1474,25 @@ void read_config(FILE* errorfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->ux2->common_data.configfile) {
+                       if (be_verbose) {
+                               fprintf(stderr, "%s %s\n", our_cnffile,
+                               mip->ux2->common_data.configfile);
+                       }
+
+                       if ((k = read_header(errorfp, write_buffer,
+                                       mip->ux2->common_data.configfile))) {
+                               mip->ux2->common_data.userconfigversion = k;
+                               if (be_verbose) {
+                                       print_device(stderr,
+                                               mip->ux2->common_data.padname,
+                                               mip->ux2->common_data.sty1name,
+                                               mip->ux2->common_data.sty2name);
+                               }
+                               read_body(errorfp, mip->ux2, ux2,
+                                       mip->ux2->common_data.configfile);
+                       }
+               }
                if (mip->bbo->common_data.configfile) {
                        if (be_verbose) {
                                fprintf(stderr, "%s %s\n", our_cnffile,
index b6e832a..32abce3 100644 (file)
@@ -30,6 +30,7 @@ const char* configversion = "4";
 
 /* Externals: */
 
+extern const int ux2;
 extern const int bbo;
 extern const int bee;
 extern const int i3;
@@ -38,6 +39,7 @@ extern const int g4;
 extern const int g4b;
 extern const int nop;
 
+extern const int ux2_num_list;
 extern const int bbo_num_list;
 extern const int bee_num_list;
 extern const int i3_num_list;
@@ -49,6 +51,129 @@ extern const int nop_num_list;
 extern const char* our_prog_name;
 
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Write a set of records tuned for a Cintiq 21UX2 tablet:
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+
+static void write_ux2(FILE* fp)
+{
+       int i;
+
+       const char* new_record =
+"%%                    # <---  ******** BEGIN NEW PROGRAM RECORD ********\n\n";
+       const char* name_tail = "# Name must be within double quotes \"\"";
+       const char* cur_tail = "# PressCurve must be within double quotes \"\"";
+       const char* sec_tail = "# Seconds (Max 10 - Min 0.01 - Or no delay)";
+       const char* tch_onoff = "# Switch 1/0 (Enable/Disable Touch Strips)";
+       const char* key_tail = "# Keycodes (Max number of keys to send is";
+       const char* tht_tail = "# Switch 1/0 (Finger held at top repeat keys)";
+       const char* thb_tail="# Switch 1/0 (Finger held at bottom repeat keys)";
+       const char* but_tail="# Switch 1/0 (Press and hold button repeat keys)";
+
+       struct ux2_program* ip;
+       ip = ux2_internal_list;
+       struct ux2_configstrings* sp;
+       sp = ux2_configstrings;
+
+       for (i = 0; i < ux2_num_list; i++, ip++) {
+               fprintf(fp, "%s", new_record);
+
+               fprintf(fp, "%s         \"%s\" %s\n\n",
+               sp->common_string.class_name, ip->common_data.class_name,
+                                                               name_tail);
+
+               fprintf(fp, "%s \"%s\" %s\n",
+               sp->common_string.stylus1_presscurve,
+                               ip->common_data.stylus1_presscurve, cur_tail);
+               fprintf(fp, "%s \"%s\" %s\n\n",
+               sp->common_string.stylus2_presscurve,
+                               ip->common_data.stylus2_presscurve, cur_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->common_string.keycode_delay, *ip->common_data.keycode_delay,
+                               *(ip->common_data.keycode_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n",
+               sp->button_string.repeat_after, *ip->button_data.repeat_after,
+                               *(ip->button_data.repeat_after+1), sec_tail);
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->button_string.repeat_delay, *ip->button_data.repeat_delay,
+                               *(ip->button_data.repeat_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n",
+               sp->touch_string.repeat_after, *ip->touch_data.repeat_after,
+                               *(ip->touch_data.repeat_after+1), sec_tail);
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->touch_string.repeat_delay, *ip->touch_data.repeat_delay,
+                               *(ip->touch_data.repeat_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i      %s\n\n",
+               sp->touch_string.handle_touch,
+                               *ip->touch_data.handle_touch, tch_onoff);
+
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->touch_string.left_touch_up,
+                       *ip->touch_data.left_touch_up,
+                       *(ip->touch_data.left_touch_up+1), key_tail, MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n\n",
+               sp->touch_string.left_touch_down,
+                       *ip->touch_data.left_touch_down,
+                       *(ip->touch_data.left_touch_down+1), key_tail, MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->touch_string.repeat_left_up,
+                               *ip->touch_data.repeat_left_up, tht_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->touch_string.repeat_left_down,
+                               *ip->touch_data.repeat_left_down, thb_tail);
+
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->touch_string.right_touch_up,
+                       *ip->touch_data.right_touch_up,
+                       *(ip->touch_data.right_touch_up+1), key_tail, MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n\n",
+               sp->touch_string.right_touch_down,
+                       *ip->touch_data.right_touch_down,
+                       *(ip->touch_data.right_touch_down+1), key_tail,MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->touch_string.repeat_right_up,
+                               *ip->touch_data.repeat_right_up, tht_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->touch_string.repeat_right_down,
+                               *ip->touch_data.repeat_right_down, thb_tail);
+
+#define UX2_BUTTON(n) \
+               fprintf(fp, "%s         %i %i   %s %i)\n", \
+                       sp->button_string.button##n, \
+                       *ip->button_data.button##n, \
+                       *(ip->button_data.button##n + 1), \
+                       key_tail, MAXKEYS); \
+               fprintf(fp, "%s         %i      %s\n", \
+                       sp->button_string.repeat##n, \
+                       *ip->button_data.repeat##n, \
+                       but_tail);
+               UX2_BUTTON(1);
+               UX2_BUTTON(2);
+               UX2_BUTTON(3);
+               UX2_BUTTON(4);
+               UX2_BUTTON(5);
+               UX2_BUTTON(6);
+               UX2_BUTTON(7);
+               UX2_BUTTON(8);
+               UX2_BUTTON(9);
+               UX2_BUTTON(10);
+               UX2_BUTTON(11);
+               UX2_BUTTON(12);
+               UX2_BUTTON(13);
+               UX2_BUTTON(14);
+               UX2_BUTTON(15);
+               UX2_BUTTON(16);
+               UX2_BUTTON(17);
+               UX2_BUTTON(18);
+       }
+}
+
+/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Write a set of records tuned for a Bamboo tablet:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
@@ -759,6 +884,37 @@ static void write_preface(FILE* fp, const int model)
        const char* model_notnop1 =
 "# Some ASCII art showing the \"default\" program record:\n"
 "#\n";
+       
+       const char* model_ux2 =
+"# Cintiq 21UX2 ExpressKeys Pad\n"
+"# +----+                 +----+\n"
+"# |  2 |                 | 11 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  3 |                 | 12 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  4 |                 | 13 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  5 |                 | 14 |\n"
+"# +----+                 +----+\n"
+"#   --                     --\n"
+"# /    \\                 /    \\\n"
+"# \\  1 /                 \\ 10 /\n"
+"#   --                     --\n"
+"# +----+                 +----+\n"
+"# |  6 |                 | 15 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  7 |                 | 16 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  8 |                 | 17 |\n"
+"# +----+                 +----+\n"
+"# +----+                 +----+\n"
+"# |  9 |                 | 18 |\n"
+"# +----+                 +----+\n\n";
 
        const char* model_bbo =
 "#      Bamboo ExpressKeys Pad\n"
@@ -895,6 +1051,9 @@ static void write_preface(FILE* fp, const int model)
                fprintf(fp, "%s", model_notnop1);
        }
 
+       if (model == ux2)
+               fprintf(fp, "%s", model_ux2);
+
        if (model == bbo)
                fprintf(fp, "%s", model_bbo);
 
@@ -946,7 +1105,9 @@ static void write_if_lacking(FILE* errorfp, const char* configfile, int model)
 
                write_preface(fp, model);
 
-               if (model == bbo) {
+               if (model == ux2) {
+                       write_ux2(fp);
+               } else if (model == bbo) {
                        write_bbo(fp);
                } else if (model == bee) {
                        write_bee(fp);
@@ -985,6 +1146,10 @@ void write_config(FILE* errorfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->ux2->common_data.configfile) {
+                       write_if_lacking(errorfp,
+                                       mip->ux2->common_data.configfile, ux2);
+               }
                if (mip->bbo->common_data.configfile) {
                        write_if_lacking(errorfp,
                                        mip->bbo->common_data.configfile, bbo);
index 4ddfdfb..cc4d3b5 100644 (file)
@@ -32,7 +32,7 @@ the longest keyword (currently RightPadTouchDown + a space = 18) + 32 keycodes
 of max 4 digits length + a space between each of them (sum 178): */
 #define MAXBUFFER 180
 /* 'Models': padless, Graphire4 BlueTooth, Graphire4, Intuos3 small, Intuos3, Bee, Bamboo */
-#define MAXMODEL 7
+#define MAXMODEL 8
 /* Max number of tablets per 'model': */
 #define MAXPAD 3
 /* Max number of styli per tablet: */
index b6790c3..d40cb43 100644 (file)
@@ -39,6 +39,7 @@ static unsigned long int* id_sty2;
 
 /* Crucial flags to keep track of the event state
  (except for the is_pad. But the future...): */
+static int is_ux2;
 static int is_bbo;
 static int is_bee;
 static int is_i3;
@@ -312,6 +313,11 @@ static void prepare_action(int fake_key, int which_action)
 
        mip = model_list;
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if ((mip->ux2->common_data.sty1id != NULL)
+               && (mip->ux2->common_data.sty1id == id_sty1)) {
+                       cdp = &mip->ux2->common_data;
+                       break;
+               }
                if ((mip->bbo->common_data.sty1id != NULL)
                && (mip->bbo->common_data.sty1id == id_sty1)) {
                        cdp = &mip->bbo->common_data;
@@ -554,6 +560,7 @@ static void do_repeat(void* base_address, void* record_address,
        XDeviceButtonEvent* tmp_button;
        XDeviceMotionEvent* tmp_motion;
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -566,14 +573,21 @@ static void do_repeat(void* base_address, void* record_address,
        struct button_data* bdp = NULL;
        struct touch_data* tdp = NULL;
 
-       if (is_bbo) {
+       if (is_ux2) {
+               pux2 = base_address;
+               base_cdp = &pux2->common_data;
+               pux2 = record_address;
+               cdp = &pux2->common_data;
+               bdp = &pux2->button_data;
+               tdp = &pux2->touch_data;
+       } else if (is_bbo) {
                pbbo = base_address;
                base_cdp = &pbbo->common_data;
                pbbo = record_address;
                cdp = &pbbo->common_data;
                bdp = &pbbo->button_data;
                tdp = &pbbo->touch_data;
-       }else if (is_bee) {
+       } else if (is_bee) {
                pbee = base_address;
                base_cdp = &pbee->common_data;
                pbee = record_address;
@@ -892,6 +906,38 @@ static void do_repeat(void* base_address, void* record_address,
                        }
 
                        switch (button->button) {
+                               case 1:
+                                       send_keys(bdp->button1, button_state);
+                                       break;
+
+                               case 2:
+                                       send_keys(bdp->button2, button_state);
+                                       break;
+
+                               case 3:
+                                       send_keys(bdp->button3, button_state);
+                                       break;
+
+                               case 4:
+                                       send_keys(bdp->button4, button_state);
+                                       break;
+
+                               case 5:
+                                       send_keys(bdp->button5, button_state);
+                                       break;
+
+                               case 6:
+                                       send_keys(bdp->button6, button_state);
+                                       break;
+
+                               case 7:
+                                       send_keys(bdp->button7, button_state);
+                                       break;
+
+                               case 8:
+                                       send_keys(bdp->button8, button_state);
+                                       break;
+
                                case 9:
                                        send_keys(bdp->button9, button_state);
                                        break;
@@ -1000,6 +1046,7 @@ static void do_motion(void* base_address, void* record_address,
                rotation = motion->axis_data[0];
        }
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -1007,7 +1054,11 @@ static void do_motion(void* base_address, void* record_address,
        struct common_data* cdp = NULL;
        struct touch_data* tdp = NULL;
 
-       if (is_bbo) {
+       if (is_ux2) {
+               pux2 = record_address;
+               cdp = &pux2->common_data;
+               tdp = &pux2->touch_data;
+       } else if (is_bbo) {
                pbbo = record_address;
                cdp = &pbbo->common_data;
                tdp = &pbbo->touch_data;
@@ -1206,6 +1257,7 @@ static void do_button(void* base_address, void* record_address,
        int repeat_button = 0;
        int ok_button = 0;
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -1217,7 +1269,11 @@ static void do_button(void* base_address, void* record_address,
        struct button_data* bdp = NULL;
        struct wheel_data* wdp = NULL;
 
-       if (is_bbo) {
+       if (is_ux2) {
+               pux2 = record_address;
+               cdp = &pux2->common_data;
+               bdp = &pux2->button_data;
+       } else if (is_bbo) {
                pbbo = record_address;
                cdp = &pbbo->common_data;
                bdp = &pbbo->button_data;
@@ -1259,8 +1315,45 @@ static void do_button(void* base_address, void* record_address,
        }
 
        switch (button->button) {
+               case 1:
+                       if (*bdp->button1) {
+                               ok_button = 1;
+                               send_keys(bdp->button1, button_state);
+                               if (*bdp->repeat1) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
+               case 2:
+                       if (*bdp->button2) {
+                               ok_button = 1;
+                               send_keys(bdp->button2, button_state);
+                               if (*bdp->repeat2) {
+                                       repeat_button = 2;
+                               }
+                       }
+                       break;
+               case 3:
+                       if (*bdp->button3) {
+                               ok_button = 1;
+                               send_keys(bdp->button3, button_state);
+                               if (*bdp->repeat3) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
                case 4:
-                       if (!*wdp->handle_wheel) {
+                       if (is_ux2) {
+                               if (*bdp->button4) {
+                                       ok_button = 1;
+                                       send_keys(bdp->button4, button_state);
+                                       if (*bdp->repeat4) {
+                                               repeat_button = 1;
+                                       }
+                               }
+                               break;
+                       }
+                       if (!wdp || !*wdp->handle_wheel) {
                                if (be_verbose) {
                                        fprintf(stderr,
                                "* Scroll Wheel is not defined/enabled in \
@@ -1284,7 +1377,17 @@ configuration file *\n");
                        }
                        return;
                case 5:
-                       if (!*wdp->handle_wheel) {
+                       if (is_ux2) {
+                               if (*bdp->button5) {
+                                       ok_button = 1;
+                                       send_keys(bdp->button5, button_state);
+                                       if (*bdp->repeat5) {
+                                               repeat_button = 1;
+                                       }
+                               }
+                               break;
+                       }
+                       if (!wdp && !*wdp->handle_wheel) {
                                if (be_verbose) {
                                        fprintf(stderr,
                                "* Scroll Wheel is not defined/enabled in \
@@ -1307,6 +1410,33 @@ configuration file *\n");
                                }
                        }
                        return;
+               case 6:
+                       if (*bdp->button6) {
+                               ok_button = 1;
+                               send_keys(bdp->button6, button_state);
+                               if (*bdp->repeat6) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
+               case 7:
+                       if (*bdp->button7) {
+                               ok_button = 1;
+                               send_keys(bdp->button7, button_state);
+                               if (*bdp->repeat7) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
+               case 8:
+                       if (*bdp->button8) {
+                               ok_button = 1;
+                               send_keys(bdp->button8, button_state);
+                               if (*bdp->repeat8) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
                case 9:
                        if (*bdp->button9) {
                                ok_button = 1;
@@ -1424,6 +1554,7 @@ configuration file *\n");
 
 static void do_stylus(void* base_address, void* record_address)
 {
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -1435,7 +1566,12 @@ static void do_stylus(void* base_address, void* record_address)
        struct common_data* cdp = NULL;
        struct common_data* base_cdp = NULL;
 
-       if (is_bbo) {
+       if (is_ux2) {
+               pux2 = base_address;
+               base_cdp = &pux2->common_data;
+               pux2 = record_address;
+               cdp = &pux2->common_data;
+       } else if (is_bbo) {
                pbbo = base_address;
                base_cdp = &pbbo->common_data;
                pbbo = record_address;
@@ -1537,6 +1673,7 @@ static void* find_focus(void* record_address, XEvent Event)
        focus_window = None;
        name_change = 0;
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -1583,7 +1720,48 @@ static void* find_focus(void* record_address, XEvent Event)
 "--------------------------------------------------------------------------\n");
        }
 
-       if (is_bbo) {
+       if (is_ux2) {
+               pux2 = record_address;
+               if ((focus_window == root) || (class_hint->res_class == NULL)) {
+                       record_address = pux2->default_program;
+                       pux2 = record_address;
+                       if (be_verbose) {
+                               fprintf(stderr, "%s %s\n", prog_focus,
+                                               pux2->common_data.class_name);
+                       }
+                       if (strcmp(namebuffer, pux2->common_data.class_name)
+                                                                       != 0) {
+                               snprintf(namebuffer, MAXBUFFER, "%s",
+                                               pux2->common_data.class_name);
+                               name_change = 1;
+                       }
+                       goto clean_up;
+               }
+               for (i = 0; i < record_num; i++, pux2++) {
+                       if (strcmp(class_hint->res_class,
+                                       pux2->common_data.class_name) == 0) {
+                               in_list = 1;
+                               break;
+                       }
+               }
+               if (!in_list) {
+                       pux2 = record_address;
+                       record_address = pux2->default_program;
+                       pux2 = record_address;
+               } else {
+                       record_address = pux2;
+               }
+               if (be_verbose) {
+                       fprintf(stderr, "%s %s\n", prog_focus,
+                                               pux2->common_data.class_name);
+               }
+               if (strcmp(namebuffer, pux2->common_data.class_name) != 0) {
+                       snprintf(namebuffer, MAXBUFFER, "%s",
+                                               pux2->common_data.class_name);
+                       name_change = 1;
+               }
+               goto clean_up;
+       } else if (is_bbo) {
                pbbo = record_address;
                if ((focus_window == root) || (class_hint->res_class == NULL)) {
                        record_address = pbbo->default_program;
@@ -1900,6 +2078,42 @@ static void* match_id(XDeviceButtonEvent* button, XDeviceMotionEvent* motion)
        if (button) {
                mip = model_list;
                for (i = 0; i < MAXPAD; i++, mip++) {
+                       if ((mip->ux2->common_data.padid != NULL
+                       && *mip->ux2->common_data.padid ==
+                                       button->deviceid)
+                       || (mip->ux2->common_data.sty1id != NULL
+                       && *mip->ux2->common_data.sty1id ==
+                                       button->deviceid)
+                       || (mip->ux2->common_data.sty2id != NULL
+                       && *mip->ux2->common_data.sty2id ==
+                                       button->deviceid)) {
+                               if (mip->ux2->default_program == NULL) {
+                                       return NULL;
+                               }
+                               if (mip->ux2->common_data.padid != NULL
+                               && *mip->ux2->common_data.padid ==
+                                                       button->deviceid) {
+                                       is_pad = 1;
+                                       id_pad = mip->ux2->common_data.padid;
+                               } else if (mip->ux2->common_data.sty1id != NULL
+                               && *mip->ux2->common_data.sty1id ==
+                                                       button->deviceid) {
+                                       is_sty1 = 1;
+                               } else if (mip->ux2->common_data.sty2id != NULL
+                               && *mip->ux2->common_data.sty2id ==
+                                                       button->deviceid) {
+                                       is_sty2 = 1;
+                               }
+                               is_ux2 = 1;
+                               record_num = mip->ux2->common_data.num_record;
+                               if (mip->ux2->common_data.sty1id != NULL) {
+                                       id_sty1 = mip->ux2->common_data.sty1id;
+                               }
+                               if (mip->ux2->common_data.sty2id != NULL) {
+                                       id_sty2 = mip->ux2->common_data.sty2id;
+                               }
+                               return mip->ux2;
+                       }
                        if ((mip->bbo->common_data.padid != NULL
                        && *mip->bbo->common_data.padid ==
                                        button->deviceid)
@@ -2146,6 +2360,24 @@ static void* match_id(XDeviceButtonEvent* button, XDeviceMotionEvent* motion)
        } else if (motion) {
                mip = model_list;
                for (i = 0; i < MAXPAD; i++, mip++) {
+                       if ((mip->ux2->common_data.padid != NULL)
+                       && (*mip->ux2->common_data.padid
+                                       == motion->deviceid)) {
+                               if (mip->ux2->default_program == NULL) {
+                                       return NULL;
+                               }
+                               is_pad = 1;
+                               is_ux2 = 1;
+                               id_pad = mip->ux2->common_data.padid;
+                               record_num = mip->ux2->common_data.num_record;
+                               if (mip->ux2->common_data.sty1id != NULL) {
+                                       id_sty1 = mip->ux2->common_data.sty1id;
+                               }
+                               if (mip->ux2->common_data.sty2id != NULL) {
+                                       id_sty2 = mip->ux2->common_data.sty2id;
+                               }
+                               return mip->ux2;
+                       }
                        if ((mip->bbo->common_data.padid != NULL)
                        && (*mip->bbo->common_data.padid
                                        == motion->deviceid)) {
@@ -2277,6 +2509,7 @@ void use_events()
                        }
                }
 
+               is_ux2 = 0;
                is_bbo = 0;
                is_bee = 0;
                is_i3 = 0;
index c84c7cd..0a0a2e8 100644 (file)
@@ -43,6 +43,7 @@ int proximity_in_type;
 int proximity_out_type;
 
 /* Used in many situations as identification, for math and for flow control: */
+const int ux2 = 7;
 const int bbo = 6;
 const int bee = 5;
 const int i3 = 4;
@@ -134,6 +135,7 @@ static int identify_device(char* device_name)
 {
        const char* cintiq_20wsx = "197"; /* 0xC5 */
        const char* cintiq_21UX = "63"; /* 0x3F */
+       const char* cintiq_21UX2 = "204"; /* 0xCC */
        const char* i3_6x8 = "177"; /* 0xB1 */
        const char* i3_9x12 = "178"; /* 0xB2 */
        const char* i3_12x12 = "179"; /* 0xB3 */
@@ -213,6 +215,9 @@ static int identify_device(char* device_name)
 
                if (ok_value) {
                        len = strcspn(read_buffer, " \t\n");
+                       if ((strncmp(read_buffer, cintiq_21UX2, len)) == 0) {
+                               return ux2;
+                       }
                        if ((strncmp(read_buffer, bamboo, len)) == 0) {
                                return bbo;
                        }
index 0cc8297..0904a82 100644 (file)
@@ -47,12 +47,16 @@ const char* total_file3_bee;
 const char* total_file1_bbo;
 const char* total_file2_bbo;
 const char* total_file3_bbo;
+const char* total_file1_ux2;
+const char* total_file2_ux2;
+const char* total_file3_ux2;
 
 /* Externals: */
 
 extern int have_pad;
 extern int have_padless;
 
+extern const int ux2;
 extern const int bbo;
 extern const int bee;
 extern const int i3;
@@ -87,6 +91,20 @@ static void mark_device(const char* device, int row, int column,
                                                        const char* configfile)
 {
        if (device == pad_string) {
+               if (row == ux2) {
+                       struct ux2_program* p = NULL;
+                       if (column == 0) {
+                               p = ux2_1_external_list;
+                       } else if (column == 1) {
+                               p = ux2_2_external_list;
+                       } else if (column == 2) {
+                               p = ux2_3_external_list;
+                       }
+                       p->common_data.padname = pad_name[row][column];
+                       p->common_data.padid = pad_id[row][column];
+                       p->common_data.configfile = configfile;
+                       return;
+               }
                if (row == bbo) {
                        struct bbo_program* p = NULL;
                        if (column == 0) {
@@ -391,8 +409,35 @@ static void mark_config(const char* device, int row, int column)
        const char* file1_bbo = "/bamboo.conf1";
        const char* file2_bbo = "/bamboo.conf2";
        const char* file3_bbo = "/bamboo.conf3";
+       const char* file1_ux2 = "/ux2.conf1";
+       const char* file2_ux2 = "/ux2.conf2";
+       const char* file3_ux2 = "/ux2.conf3";
 
        switch (row) {
+/* pad Cintiq 21ux2 */
+       case 7:
+               switch (column) {
+               case 0:
+                       total_file1_ux2 = path_malloc
+                               ((void*)total_config_dir, (void*)file1_ux2);
+                       mark_device(device, row, column, total_file1_ux2);
+                       return;
+
+               case 1:
+                       total_file2_ux2 = path_malloc
+                               ((void*)total_config_dir, (void*)file2_ux2);
+                       mark_device(device, row, column, total_file2_ux2);
+                       return;
+
+               case 2:
+                       total_file3_ux2 = path_malloc
+                               ((void*)total_config_dir, (void*)file3_ux2);
+                       mark_device(device, row, column, total_file3_ux2);
+                       return;
+
+               default:
+                       return;
+               }
 /* pad Bamboo */
        case 6:
                switch (column) {
index 1abed65..c81b77b 100644 (file)
@@ -43,6 +43,7 @@ const char* sty2str = "CurrentSty2";
 extern int ok_config;
 extern int go_daemon;
 
+extern const int ux2;
 extern const int bbo;
 extern const int bee;
 extern const int i3;
@@ -91,6 +92,9 @@ extern char* total_file3_bee;
 extern char* total_file1_bbo;
 extern char* total_file2_bbo;
 extern char* total_file3_bbo;
+extern char* total_file1_ux2;
+extern char* total_file2_ux2;
+extern char* total_file3_ux2;
 
 extern void read_config(FILE* errorfp);
 
@@ -104,7 +108,7 @@ void report_header(FILE* statusfp)
 
        fprintf(statusfp,
 "\n'Models': nopad, Graphire4 BlueTooth, Graphire4, Intuos3 small, \
-Intuos3/Cintiq, Cintiq 20wsx, Bamboo\n");
+Intuos3/Cintiq, Cintiq 20wsx, Bamboo, Cintiq 21UX2\n");
        fprintf(statusfp, "\n* Pad-index *\n");
        fprintf(statusfp, "%i (nop): 0 1 2\n", nop);
        fprintf(statusfp, "%i (g4b): 0 1 2\n", g4b);
@@ -112,12 +116,13 @@ Intuos3/Cintiq, Cintiq 20wsx, Bamboo\n");
        fprintf(statusfp, "%i (i3s): 0 1 2\n", i3s);
        fprintf(statusfp, "%i (i3 ): 0 1 2\n", i3);
        fprintf(statusfp, "%i (bee): 0 1 2\n", bee);
-       fprintf(statusfp, "%i (bbo): 0 1 2\n\n", bbo);
+       fprintf(statusfp, "%i (bbo): 0 1 2\n", bbo);
+       fprintf(statusfp, "%i (ux2): 0 1 2\n\n", ux2);
        fprintf(statusfp, "* Stylus-index *\n");
        fprintf(statusfp, "0 st1 (nop): 0 1 2 (g4b): 3 4 5 (g4): 6 7 8 \
-(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16\n");
+(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16 (bbo): 17 18 (ux2): 19 20\n");
        fprintf(statusfp, "1 st2 (nop): 0 1 2 (g4b): 3 4 5 (g4): 6 7 8 \
-(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16\n\n");
+(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16 (bbo): 17 18 (ux2): 19 20\n\n");
        fprintf(statusfp, "PGR RUNNAME = %s\n", our_prog_name);
        fprintf(statusfp, "PGR VERSION = %s\n", our_prog_version);
        fprintf(statusfp, "USR HOMEDIR = %s\n", getenv("HOME"));
@@ -151,6 +156,7 @@ Intuos3/Cintiq, Cintiq 20wsx, Bamboo\n");
 
 static void report_record(FILE* statusfp, void* address, const int model)
 {
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -160,7 +166,10 @@ static void report_record(FILE* statusfp, void* address, const int model)
        struct nop_program* pnop;
        struct common_data* cdp = NULL;
 
-       if (model == bbo) {
+       if (model == ux2) {
+               pux2 = address;
+               cdp = &pux2->common_data;
+       } else if (model == bbo) {
                pbbo = address;
                cdp = &pbbo->common_data;
        } else if (model == bee) {
@@ -224,6 +233,7 @@ static void report_common(FILE* statusfp)
        int num_record;
        const char* pgr_records = "PGR RECORDS =";
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -236,6 +246,20 @@ static void report_common(FILE* statusfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->ux2->common_data.num_record) {
+                       print_common(statusfp, mip->ux2->common_data.configfile,
+                                       mip->ux2->common_data.userconfigversion,
+                                               mip->ux2->common_data.padname,
+                                               mip->ux2->common_data.sty1name,
+                                               mip->ux2->common_data.sty2name);
+                       num_record = mip->ux2->common_data.num_record;
+                       pux2 = mip->ux2;
+                       for (j = 0; j < num_record; j++, pux2++) {
+                               report_record(statusfp, pux2, ux2);
+                       }
+                       fprintf(statusfp, "%s %i (of max %i)\n\n", pgr_records,
+                                                       num_record, MAXRECORDS);
+               }
                if (mip->bbo->common_data.num_record) {
                        print_common(statusfp, mip->bbo->common_data.configfile,
                                        mip->bbo->common_data.userconfigversion,
@@ -414,6 +438,7 @@ void re_read_config(int signum)
 
 static void free_common(void* address, const int model)
 {
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -423,7 +448,10 @@ static void free_common(void* address, const int model)
        struct nop_program* pnop;
        struct common_data* cdp = NULL;
 
-       if (model == bbo) {
+       if (model == ux2) {
+               pux2 = address;
+               cdp = &pux2->common_data;
+       } else if (model == bbo) {
                pbbo = address;
                cdp = &pbbo->common_data;
        } else if (model == bee) {
@@ -473,6 +501,7 @@ void clean_up_exit(int signum)
 {
        int i, j;
 
+       struct ux2_program* pux2;
        struct bbo_program* pbbo;
        struct bee_program* pbee;
        struct i3_program* pi3;
@@ -498,6 +527,12 @@ void clean_up_exit(int signum)
 
        mip = model_list;
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->ux2->common_data.configfile) {
+                       pux2 = mip->ux2;
+                       for (j = 0; j < MAXRECORDS; j++, pux2++) {
+                               free_common(pux2, ux2);
+                       }
+               }
                if (mip->bbo->common_data.configfile) {
                        pbbo = mip->bbo;
                        for (j = 0; j < MAXRECORDS; j++, pbbo++) {
@@ -649,6 +684,18 @@ void clean_up_exit(int signum)
                free(total_file3_bbo);
        }
 
+/*---*/
+
+       if (total_file1_ux2) {
+               free(total_file1_ux2);
+       }
+       if (total_file2_ux2) {
+               free(total_file2_ux2);
+       }
+       if (total_file3_ux2) {
+               free(total_file3_ux2);
+       }
+
 /* The pad devices and styli devices should not be explicitly closed by a
  call to XCloseDevice. It leaves a message from X (in the terminal where X
  is started from) saying: "ProcXCloseDevice to close or not ?" Instead we
index 1533785..8d6cf98 100644 (file)
 
 /* Globals: */
 
+struct ux2_program ux2_internal_list[] = {
+       {
+       .common_data = {
+               .class_name = "default",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 0 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 994, 0 },
+               .left_touch_down = { 995, 0 },
+               .right_touch_up = { 98, 0 },
+               .right_touch_down = { 104, 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button1 = { 50, 0 },
+               .button2 = { 64, 0 },
+               .button3 = { 37, 0 },
+               .button4 = { 65, 0 },
+               .button5 = { 50, 0 },
+               .button6 = { 64, 0 },
+               .button7 = { 37, 0 },
+               .button8 = { 65, 0 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 50, 0 },
+               .button14 = { 64, 0 },
+               .button15 = { 37, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Gimp",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 0 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .left_touch_up = { 20, 0 },
+               .left_touch_down = { 61, 0 },
+               .right_touch_up = { 98, 20 },
+               .right_touch_down = { 104, 61 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Blender",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 0 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 102, 0 },
+               .left_touch_down = { 100, 0 },
+               .right_touch_up = { 98, 0 },
+               .right_touch_down = { 104, 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 0 },
+               .button10 = { 9, 0 },
+               .button11 = { 50, 0 },
+               .button12 = { 23, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "XTerm",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button15 = { 999, 0 },
+               },
+       },
+};
+const int ux2_num_list = (sizeof ux2_internal_list / sizeof ux2_internal_list[0]);
+
+struct ux2_program ux2_1_external_list[MAXRECORDS];
+struct ux2_program ux2_2_external_list[MAXRECORDS];
+struct ux2_program ux2_3_external_list[MAXRECORDS];
+
+struct ux2_configstrings ux2_configstrings[] = {
+{
+       .common_string = {"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
+       .touch_string = {"HandleTouchStrips", "TouchRepeatAfter", "DelayTouchRepeat",
+                        "RepeatLeftUp", "RepeatLeftDown", "RepeatRightUp", "RepeatRightDown",
+                        "LeftPadTouchUp", "LeftPadTouchDown", "RightPadTouchUp", "RightPadTouchDown"},
+       .button_string = {
+               .repeat_after = "ButtonRepeatAfter",
+               .repeat_delay = "DelayButtonRepeat",
+               .repeat1 = "RepeatButton1",
+               .repeat2 = "RepeatButton2",
+               .repeat3 = "RepeatButton3",
+               .repeat4 = "RepeatButton4",
+               .repeat5 = "RepeatButton5",
+               .repeat6 = "RepeatButton6",
+               .repeat7 = "RepeatButton7",
+               .repeat8 = "RepeatButton8",
+               .repeat9 = "RepeatButton9",
+               .repeat10 = "RepeatButton10",
+               .repeat11 = "RepeatButton11",
+               .repeat12 = "RepeatButton12",
+               .repeat13 = "RepeatButton13",
+               .repeat14 = "RepeatButton14",
+               .repeat15 = "RepeatButton15",
+               .repeat16 = "RepeatButton16",
+               .repeat17 = "RepeatButton17",
+               .repeat18 = "RepeatButton18",
+               .button1 = "LeftPadButton1",
+               .button2 = "LeftPadButton2",
+               .button3 = "LeftPadButton3",
+               .button4 = "LeftPadButton4",
+               .button5 = "LeftPadButton5",
+               .button6 = "LeftPadButton6",
+               .button7 = "LeftPadButton7",
+               .button8 = "LeftPadButton8",
+               .button9 = "LeftPadButton9",
+               .button10 = "RightPadButton10",
+               .button11 = "RightPadButton11",
+               .button12 = "RightPadButton12",
+               .button13 = "RightPadButton13",
+               .button14 = "RightPadButton14",
+               .button15 = "RightPadButton15",
+               .button16 = "RightPadButton16",
+               .button17 = "RightPadButton17",
+               .button18 = "RightPadButton18",
+       },
+}};
+
 struct bbo_program bbo_internal_list[] = {
        {
        .common_data = {
@@ -143,7 +321,9 @@ struct bbo_configstrings bbo_configstrings[] = {
 {"HandleTouchRing", "TouchRepeatAfter", "DelayTouchRepeat",
 "RepeatUp", "RepeatDown", NULL, NULL, "PadTouchUp", "PadTouchDown", NULL, NULL},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12", NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "LeftPadButton9", "LeftPadButton10", "RightPadButton11", "RightPadButton12",  NULL, NULL, NULL, NULL, NULL, NULL}}
 };
 
@@ -275,43 +455,145 @@ struct bee_configstrings bee_configstrings[] = {
 "RepeatLeftUp", "RepeatLeftDown", "RepeatRightUp", "RepeatRightDown",
 "LeftPadTouchUp", "LeftPadTouchDown", "RightPadTouchUp", "RightPadTouchDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
 "RepeatButton13", "RepeatButton14", "RepeatButton15", "RepeatButton16",
 "RepeatButton17", "RepeatButton18",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12",
 "RightPadButton13", "RightPadButton14", "RightPadButton15", "RightPadButton16",
 "LeftPadButton17", "RightPadButton18"}}
 };
 
 struct i3_program i3_internal_list[] = {
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"default", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{1},{1},{1},{1},
-       {994,0},{995,0},{98,0},{104,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0},{37,0},{65,0},
-       {50,0},{64,0},{37,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{0},{0},{0},{0},
-       {20,0},{61,0},{64,20},{64,61}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0},{37,0},{65,0},
-       {37,29},{37,52},{999,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{1},{1},{1},{1},
-       {102,0},{100,0},{98,0},{104,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,0},{9,0},{50,0},{23,0},
-       {37,29},{37,52},{999,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
-       {{0},{0,6},{0,1},{0},{0},{0},{0},
-       {0,0},{0,0},{0,0},{0,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{0,0},{0,0},{0,0},
-       {0,0},{0,0},{999,0},{0,0},}}
+       {
+       .common_data = {
+               .class_name = "default",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 1 },
+               .left_touch_down = { 1 },
+               .right_touch_up = { 1 },
+               .right_touch_down = { 1 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 50, 0 },
+               .button14 = { 64, 0 },
+               .button15 = { 37, 0 },
+               .button16 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Gimp",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 0 },
+               .repeat_left_down = { 0 },
+               .repeat_right_up = { 0 },
+               .repeat_right_down = { 0 },
+               .left_touch_up = { 20, 0 },
+               .left_touch_down = { 61, 0 },
+               .right_touch_up = { 64, 20 },
+               .right_touch_down = { 64, 61 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Blender",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 102, 0 },
+               .left_touch_down = { 100, 0 },
+               .right_touch_up = { 98, 20 },
+               .right_touch_down = { 104, 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 0 },
+               .button10 = { 9, 0 },
+               .button11 = { 50, 0 },
+               .button12 = { 23, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "XTerm",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 0 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 0 },
+               .repeat_left_down = { 0 },
+               .repeat_right_up = { 0 },
+               .repeat_right_down = { 0 },
+               .left_touch_up = { 0 },
+               .left_touch_down = { 0 },
+               .right_touch_up = { 0 },
+               .right_touch_down = { 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 0, 0 },
+               .button10 = { 0, 0 },
+               .button11 = { 0, 0 },
+               .button12 = { 0, 0 },
+               .button13 = { 0, 0 },
+               .button14 = { 0, 0 },
+               .button15 = { 999, 0 },
+               .button16 = { 0, 0 },
+               },
+       },
 };
 const int i3_num_list = (sizeof i3_internal_list / sizeof i3_internal_list[0]);
 
@@ -324,40 +606,118 @@ struct i3_configstrings i3_configstrings[] = {
 {"HandleTouchStrips", "TouchRepeatAfter", "DelayTouchRepeat",
 "RepeatLeftUp", "RepeatLeftDown", "RepeatRightUp", "RepeatRightDown",
 "LeftPadTouchUp", "LeftPadTouchDown", "RightPadTouchUp", "RightPadTouchDown"},
-{"ButtonRepeatAfter", "DelayButtonRepeat",
-"RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
-"RepeatButton13", "RepeatButton14", "RepeatButton15", "RepeatButton16",
-NULL,NULL,
-"LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12",
-"RightPadButton13", "RightPadButton14", "RightPadButton15", "RightPadButton16",
-NULL, NULL}}
+{
+       .repeat_after = "ButtonRepeatAfter",
+       .repeat_delay = "DelayButtonRepeat",
+       .repeat9 = "LeftPadButton9",
+       .repeat10 = "LeftPadButton10",
+       .repeat11 = "LeftPadButton11",
+       .repeat12 = "LeftPadButton12",
+       .repeat13 = "LeftPadButton13",
+       .repeat14 = "LeftPadButton14",
+       .repeat15 = "LeftPadButton15",
+       .repeat16 = "LeftPadButton16",
+       .button9 = "LeftPadButton9",
+       .button10 = "LeftPadButton10",
+       .button11 = "LeftPadButton11",
+       .button12 = "LeftPadButton12",
+       .button13 = "RightPadButton13",
+       .button14 = "RightPadButton14",
+       .button15 = "RightPadButton15",
+       .button16 = "RightPadButton16",
+}}
 };
 
 struct i3s_program i3s_internal_list[] = {
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"default", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{1},{1},{0},{0},
-       {994,0},{995,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0},{37,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{0},{0},{0},{0},
-       {20,0},{61,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},{999,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
-       {{1},{0,6},{0,1},{1},{1},{0},{0},
-       {102,0},{100,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},{999,0},{65,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
-       {{0},{0,6},{0,1},{0},{0},{0},{0},
-       {0,0},{0,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{0,0},{999,0},{0,0},}}
+       {
+       .common_data = {
+               .class_name = "default",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .left_touch_up = { 994,0 },
+               .left_touch_down = { 995,0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Gimp",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 0 },
+               .repeat_left_down = { 0 },
+               .left_touch_up = { 20,0 },
+               .left_touch_down = { 61,0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 29 },
+               .button10 = { 37, 52 },
+               .button11 = { 999, 0 },
+               .button12 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Blender",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .left_touch_up = { 102,0 },
+               .left_touch_down = { 100,0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 29 },
+               .button10 = { 37, 52 },
+               .button11 = { 999, 0 },
+               .button12 = { 65, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "XTerm",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 0 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button11 = { 999, 0 },
+               },
+       },
 };
 const int i3s_num_list = (sizeof i3s_internal_list / sizeof
                                                        i3s_internal_list[0]);
@@ -371,8 +731,10 @@ struct i3s_configstrings i3s_configstrings[] = {
 {"HandleTouchStrips", "TouchRepeatAfter", "DelayTouchRepeat",
 "RepeatLeftUp","RepeatLeftDown",NULL,NULL,"LeftPadTouchUp", "LeftPadTouchDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
 NULL,NULL,NULL,NULL,NULL,NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12"}}
 };
 
@@ -458,27 +820,64 @@ struct g4_configstrings g4_configstrings[] = {
 {{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
 {"HandleScrollWheel", "ScrollWheelUp", "ScrollWheelDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "RepeatLeft", NULL, NULL, NULL, "RepeatRight", NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "LeftButton", NULL, NULL, NULL, "RightButton"}}
 };
 
 struct g4b_program g4b_internal_list[] = {
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"default", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},}},
-       {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
-       {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{999,0},}}
+       {
+       .common_data = {
+               .class_name = "default",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button11 = { 64, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Gimp",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 29 },
+               .button11 = { 37, 52 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Blender",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 29 },
+               .button11 = { 37, 52 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "XTerm",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button11 = { 999, 0 },
+               },
+       },
 };
 const int g4b_num_list = (sizeof g4b_internal_list / sizeof
                                                        g4b_internal_list[0]);
@@ -490,7 +889,9 @@ struct g4b_program g4b_3_external_list[MAXRECORDS];
 struct g4b_configstrings g4b_configstrings[] = {
 {{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 "LeftButton", "RightButton"}}
 };
 
@@ -516,12 +917,12 @@ struct nop_configstrings nop_configstrings[] = {
 };
 
 struct model_index model_list[] = {
-       {bbo_1_external_list, bee_1_external_list, i3_1_external_list, i3s_1_external_list,
-        g4_1_external_list, g4b_1_external_list, nop_1_external_list},
-       {bbo_2_external_list, bee_2_external_list, i3_2_external_list, i3s_2_external_list,
-        g4_2_external_list, g4b_2_external_list, nop_2_external_list},
-       {bbo_3_external_list, bee_3_external_list, i3_3_external_list, i3s_3_external_list,
-        g4_3_external_list, g4b_3_external_list, nop_3_external_list}
+       {ux2_1_external_list, bbo_1_external_list, bee_1_external_list, i3_1_external_list,
+        i3s_1_external_list, g4_1_external_list, g4b_1_external_list, nop_1_external_list},
+       {ux2_2_external_list, bbo_2_external_list, bee_2_external_list, i3_2_external_list,
+        i3s_2_external_list, g4_2_external_list, g4b_2_external_list, nop_2_external_list},
+       {ux2_3_external_list, bbo_3_external_list, bee_3_external_list, i3_3_external_list,
+        i3s_3_external_list, g4_3_external_list, g4b_3_external_list, nop_3_external_list}
 };
 
 /* End Code */
index 6c47285..1216580 100644 (file)
@@ -66,6 +66,14 @@ extern struct wheel_data {
 extern struct button_data {
        int repeat_after[2];
        int repeat_delay[2];
+       int repeat1 [1];
+       int repeat2 [1];
+       int repeat3 [1];
+       int repeat4 [1];
+       int repeat5 [1];
+       int repeat6 [1];
+       int repeat7 [1];
+       int repeat8 [1];
        int repeat9 [1];
        int repeat10 [1];
        int repeat11 [1];
@@ -76,6 +84,14 @@ extern struct button_data {
        int repeat16 [1];
        int repeat17 [1];
        int repeat18 [1];
+       int button1[MAXKEYS];
+       int button2[MAXKEYS];
+       int button3[MAXKEYS];
+       int button4[MAXKEYS];
+       int button5[MAXKEYS];
+       int button6[MAXKEYS];
+       int button7[MAXKEYS];
+       int button8[MAXKEYS];
        int button9[MAXKEYS];
        int button10[MAXKEYS];
        int button11[MAXKEYS];
@@ -90,6 +106,13 @@ extern struct button_data {
 
 
 /* Data structures (consolidation): */
+extern struct ux2_program {
+       struct ux2_program* default_program;
+       struct common_data common_data;
+       struct touch_data touch_data;
+       struct button_data button_data;
+} ux2_internal_list[], ux2_1_external_list[], ux2_2_external_list[],
+                                                       ux2_3_external_list[];
 
 extern struct bbo_program {
        struct bbo_program* default_program;
@@ -178,6 +201,14 @@ extern struct wheel_string {
 extern struct button_string {
        const char* repeat_after;
        const char* repeat_delay;
+       const char* repeat1;
+       const char* repeat2;
+       const char* repeat3;
+       const char* repeat4;
+       const char* repeat5;
+       const char* repeat6;
+       const char* repeat7;
+       const char* repeat8;
        const char* repeat9;
        const char* repeat10;
        const char* repeat11;
@@ -188,6 +219,14 @@ extern struct button_string {
        const char* repeat16;
        const char* repeat17;
        const char* repeat18;
+       const char* button1;
+       const char* button2;
+       const char* button3;
+       const char* button4;
+       const char* button5;
+       const char* button6;
+       const char* button7;
+       const char* button8;
        const char* button9;
        const char* button10;
        const char* button11;
@@ -203,6 +242,12 @@ extern struct button_string {
 
 /* String structures (consolidation): */
 
+extern struct ux2_configstrings {
+       struct common_string common_string;
+       struct touch_string touch_string;
+       struct button_string button_string;
+} ux2_configstrings[];
+
 extern struct bbo_configstrings {
        struct common_string common_string;
        struct wheel_string wheel_string;
@@ -247,6 +292,7 @@ extern struct nop_configstrings {
 /* Data structure (final consolidation): */
 
 extern struct model_index {
+       struct ux2_program* ux2;
        struct bbo_program* bbo;
        struct bee_program* bee;
        struct i3_program* i3;