{
char * f_name = "get_kb_line_and_iterate()";
struct KeyBinding * kb_p = * kb_pp;
- char * keyname = get_keyname_to_keycode(kb_p->key);
- struct Command * command = get_command_to_keycode(kb_p, kb_p->key);
+ char * keyname = get_keyname_to_keycode(kb_p->keycode);
+ struct Command * command = get_command_to_keycode(kb_p, kb_p->keycode);
uint16_t size = 9 + 1 + strlen(command->dsc_long) + 1;
char * line = try_malloc(size, f_name);
sprintf(line, "%-9s %s", keyname, command->dsc_long);
extern struct Command * get_command_to_keycode(struct KeyBinding * kb_p,
- uint16_t key)
+ uint16_t keycode)
{
while (0 != kb_p)
{
- if (key == kb_p->key)
+ if (keycode == kb_p->keycode)
{
return kb_p->command;
}
kb_p = kbd->kbs;
while (0 != kb_p)
{
- sprintf(line, "%d %s\n", kb_p->key, kb_p->command->dsc_short);
+ sprintf(line, "%d %s\n", kb_p->keycode, kb_p->command->dsc_short);
try_fwrite(line, sizeof(char), strlen(line), file, f_name);
kb_p = kb_p->next;
}
kb_p->command = get_command(ptr_space + 1);
err_line(!(kb_p->command), line, context, err_cmd);
kb_p->next = 0;
- kb_p->key = atoi(line);
+ kb_p->keycode = atoi(line);
loc_last_ptr = & kb_p->next;
}
}
kbd->edit = 1;
draw_all_wins();
cbreak();
- int key = getch();
+ int keycode = getch();
halfdelay(world.halfdelay);
- if (key < 1000)
+ if (keycode < 1000)
{
struct KeyBinding * kb_p = get_keyb_of_n(kbd->kbs, kbd->select);
- kb_p->key = key;
+ kb_p->keycode = keycode;
}
kbd->edit = 0;
}
struct KeyBinding
{
struct KeyBinding * next;
- uint16_t key; /* keycode */
+ uint16_t keycode;
struct Command * command; /* command in command DB to which key is bound */
};
/* Return command bound to keycode; NULL on failure. */
extern struct Command * get_command_to_keycode(struct KeyBinding * kb_p,
- uint16_t key);
+ uint16_t keycode);
/* Return human-readable name (of maximum 9 chars) for "keycode" as matched by
* ncurses.h; if none is found, return "UNKNOWN".