History

command: add input-key-list property

wm4 committed 6 years ago

Commit a58b2df1 parent c6369934 files · +29 −0Browse files

Showing the changes to input (2 of 4 files). Show all

Unified · Split

2 files
  1. input/keycodes.c +10 −0
  2. input/keycodes.h +1 −0
input/keycodes.c+10−0
@@ -322,6 +322,16 @@ void mp_print_key_list(struct mp_log *out) · 321 unmodified lines
322 mp_info(out, "%s\n", key_names[i].name);322 mp_info(out, "%s\n", key_names[i].name);
323}323}
324 324
325char **mp_get_key_list(void)
326{
327 char **list = NULL;
328 int num = 0;
329 for (int i = 0; key_names[i].name != NULL; i++)
330 MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, key_names[i].name));
331 MP_TARRAY_APPEND(NULL, list, num, NULL);
332 return list;
333}
334
325int mp_normalize_keycode(int keycode)335int mp_normalize_keycode(int keycode)
326{336{
327 if (keycode <= 0)337 if (keycode <= 0)
input/keycodes.h+1−0
@@ -253,5 +253,6 @@ int mp_input_get_keys_from_string(char *str, int max_num_keys, · 252 unmodified lines
253 253
254struct mp_log;254struct mp_log;
255void mp_print_key_list(struct mp_log *out);255void mp_print_key_list(struct mp_log *out);
256char **mp_get_key_list(void);
256 257
257#endif /* MPLAYER_KEYCODES_H */258#endif /* MPLAYER_KEYCODES_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t