changeset 945:17ef145f3326

Display and use UTF-8 key codes UTF-8 key codes can be used for key bindings, for example /bind MU224 = ... will bind "Meta-a`".
author Mikael Berthe <mikael@lilotux.net>
date Wed, 09 Aug 2006 20:28:41 +0200
parents aec71ebf98fa
children 5c1dfc8e54d7
files mcabber/src/screen.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/screen.c	Wed Aug 09 20:26:06 2006 +0200
+++ b/mcabber/src/screen.c	Wed Aug 09 20:28:41 2006 +0200
@@ -2419,15 +2419,20 @@
 
 static int bindcommand(keycode kcode)
 {
-  gchar asciikey[16];
+  gchar asciikey[16], asciicode[16];
   const gchar *boundcmd;
 
+  if (kcode.utf8)
+    g_snprintf(asciicode, 15, "U%d", kcode.value);
+  else
+    g_snprintf(asciicode, 15, "%d", kcode.value);
+
   if (!kcode.mcode || kcode.mcode == MKEY_EQUIV)
-    g_snprintf(asciikey, 15, "%d", kcode.value);
+    g_snprintf(asciikey, 15, "%s", asciicode);
   else if (kcode.mcode == MKEY_META)
-    g_snprintf(asciikey, 15, "M%d", kcode.value);
+    g_snprintf(asciikey, 15, "M%s", asciicode);
   else
-    g_snprintf(asciikey, 15, "MK%d", kcode.mcode);
+    g_snprintf(asciikey, 15, "MK%s", asciicode);
 
   boundcmd = settings_get(SETTINGS_TYPE_BINDING, asciikey);