Index: src/hid_cfg_input.c =================================================================== --- src/hid_cfg_input.c (revision 1562) +++ src/hid_cfg_input.c (revision 1563) @@ -245,7 +245,7 @@ } -int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const char *keydesc, lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len) +int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydescn, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len) { const char *curr, *next, *last, *k; hid_cfg_mod_t mods[HIDCFG_MAX_KEYSEQ_LEN]; @@ -252,6 +252,8 @@ unsigned short int key_chars[HIDCFG_MAX_KEYSEQ_LEN]; int n, slen, len; hid_cfg_keyseq_t *lasts; +#warning TODO: keydescn may be a list + const char *keydesc = keydescn->data.text.value; slen = 0; curr = keydesc; Index: src/hid_cfg_input.h =================================================================== --- src/hid_cfg_input.h (revision 1562) +++ src/hid_cfg_input.h (revision 1563) @@ -52,7 +52,7 @@ struct hid_cfg_keyseq_s { unsigned long int keysym; /* optional 32 bit long storage the GUI hid should cast to whatever the GUI backend supports */ - lht_node_t *action_node; /* terminal node: end of sequence, run actions */ + const lht_node_t *action_node; /* terminal node: end of sequence, run actions */ htip_t seq_next; /* ... or if node is NULL, a hash for each key that may follow the current one */ hid_cfg_keyseq_t *parent; @@ -102,7 +102,7 @@ key in the sequence, up to out_seq_len. Returns -1 on failure or the length of the sequence. */ -int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const char *keydesc, lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len); +int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydesc, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len); /* Process next input key stroke. Seq and seq_len must not be NULL as they are the internal state of multi-key Index: src_plugins/hid_gtk/ghid-main-menu.c =================================================================== --- src_plugins/hid_gtk/ghid-main-menu.c (revision 1562) +++ src_plugins/hid_gtk/ghid-main-menu.c (revision 1563) @@ -65,16 +65,14 @@ const gchar *accel = NULL; char *menu_label; lht_node_t *n_action = hid_cfg_menu_field(sub_res, MF_ACTION, NULL); + lht_node_t *n_keydesc = hid_cfg_menu_field(sub_res, MF_ACCELERATOR, NULL); /* Resolve accelerator and save it */ tmp_val = hid_cfg_menu_field_str(sub_res, MF_ACCELERATOR); if (tmp_val != NULL) { - lht_node_t *anode; - assert(node != NULL); - anode = hid_cfg_menu_field(sub_res, MF_ACTION, NULL); - if (anode != NULL) { - hid_cfg_keys_add_by_desc(&ghid_keymap, tmp_val, anode, NULL, 0); + if (n_action != NULL) { + hid_cfg_keys_add_by_desc(&ghid_keymap, n_keydesc, n_action, NULL, 0); #warning TODO: this has to be a functio that respects lists accel = tmp_val; } Index: src_plugins/hid_lesstif/menu.c =================================================================== --- src_plugins/hid_lesstif/menu.c (revision 1562) +++ src_plugins/hid_lesstif/menu.c (revision 1563) @@ -43,7 +43,7 @@ static Colormap cmap; -static void note_accelerator(const char *acc, lht_node_t *node); +static void note_accelerator(const lht_node_t *node); static void note_widget_flag(Widget w, char *type, const char *name); static const char getxy_syntax[] = "GetXY()"; @@ -705,13 +705,14 @@ hid_cfg_action(node); } -static void note_accelerator(const char *acc, lht_node_t *node) +static void note_accelerator(const lht_node_t *node) { - lht_node_t *anode; + lht_node_t *anode, *knode; assert(node != NULL); anode = hid_cfg_menu_field(node, MF_ACTION, NULL); - if (anode != NULL) - hid_cfg_keys_add_by_desc(&lesstif_keymap, acc, anode, NULL, 0); + knode = hid_cfg_menu_field(node, MF_ACCELERATOR, NULL); + if ((anode != NULL) && (knode != NULL)) + hid_cfg_keys_add_by_desc(&lesstif_keymap, knode, anode, NULL, 0); else hid_cfg_error(node, "No action specified for key accel\n"); } @@ -836,7 +837,8 @@ XmString as = XmStringCreatePCB(strdup(r)); stdarg(XmNacceleratorText, as); /*stdarg(XmNaccelerator, r->v[1].value); */ - note_accelerator(r, node); +#warning TODO: pass lht_node_t here, build the string from the transformed variant above + note_accelerator(node); } v = node->name;