summaryrefslogtreecommitdiff
path: root/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index a9875bc..396ed1a 100644
--- a/shared.c
+++ b/shared.c
@@ -45,6 +45,22 @@ get_linux_keycode_by_name(const char *name)
return NULL;
}
+struct linux_input_keycode *
+get_linux_keycode_by_value(uint32_t value)
+{
+ struct linux_input_keycode *lik = NULL;
+ unsigned i;
+
+ for (i = 0; linux_input_keycodes[i].name; i++) {
+ if (linux_input_keycodes[i].value == value) {
+ lik = &linux_input_keycodes[i];
+ break;
+ }
+ }
+
+ return lik;
+}
+
int
strtol_strict(const char *str, int *result)
{