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
322322 mp_info(out, "%s\n", key_names[i].name);
323323 }
324324
325+char **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+
325335 int mp_normalize_keycode(int keycode)
326336 {
327337 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
253253
254254 struct mp_log;
255255 void mp_print_key_list(struct mp_log *out);
256+char **mp_get_key_list(void);
256257
257258 #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