Keycontrol: function to obtain key name

This commit is contained in:
Martin Pulec
2019-11-04 10:35:17 +01:00
parent 7693b3e1e5
commit e52874998c
2 changed files with 9 additions and 0 deletions

View File

@@ -882,3 +882,9 @@ bool keycontrol_register_key(struct module *receiver_mod, int64_t key, const cha
return true;
}
void get_keycode_name(int64_t ch, char *buf, size_t buflen) {
string name = get_keycode_representation(ch);
strncpy(buf, name.c_str(), buflen - 1);
buf[buflen - 1] = '\0';
}