uterm: input: add uterm_input_keysym_to_string()
authorDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 31 Jul 2012 08:00:03 +0000 (10:00 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 31 Jul 2012 08:00:03 +0000 (10:00 +0200)
There is no much gain from having an internal kbd_desc_keysym_to_string()
function if we cannot get access to the kbd_desc object. Therefore, add a
forward helper to uterm_input() which forwards the call to its internal
kbd_desc object. This allows outside access to the keysym_to_string()
function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm.h
src/uterm_input.c

index 89a89bb..24caf14 100644 (file)
@@ -298,6 +298,9 @@ void uterm_input_sleep(struct uterm_input *input);
 void uterm_input_wake_up(struct uterm_input *input);
 bool uterm_input_is_awake(struct uterm_input *input);
 
+void uterm_input_keysym_to_string(struct uterm_input *input,
+                                 uint32_t keysym, char *str, size_t size);
+
 /*
  * System Monitor
  * This watches the system for new seats, graphics devices or other devices that
index 387e845..53b0731 100644 (file)
@@ -465,3 +465,16 @@ bool uterm_input_is_awake(struct uterm_input *input)
 
        return input->awake;
 }
+
+void uterm_input_keysym_to_string(struct uterm_input *input,
+                                 uint32_t keysym, char *str, size_t size)
+{
+       if (!str || !size)
+               return;
+       if (!input) {
+               *str = 0;
+               return;
+       }
+
+       kbd_desc_keysym_to_string(input->desc, keysym, str, size);
+}