diff mcabber/src/screen.c @ 288:1eea0fa0955e

Add /bind command * Split process_line() to process_line() + process_command() * Do not expand aliases in multi-line mode * Add /bind command The binding system is ugly (not UTF-8 compatible, I think, and certainly system dependant because it is using ncurses wgetch() values).
author Mikael Berthe <mikael@lilotux.net>
date Fri, 08 Jul 2005 21:47:17 +0100
parents edc263a5d350
children 566818afee1c
line wrap: on
line diff
--- a/mcabber/src/screen.c	Fri Jul 08 07:31:24 2005 +0100
+++ b/mcabber/src/screen.c	Fri Jul 08 21:47:17 2005 +0100
@@ -1608,9 +1608,19 @@
           scr_Resize();
           break;
       default:
-          scr_LogPrint("Unknown key=%d", key);
-          if (utf8_mode)
-            scr_LogPrint("WARNING: UTF-8 not yet supported!");
+          {
+            const gchar *boundcmd = isbound(key);
+            if (boundcmd) {
+              gchar *cmd = g_strdup_printf("/%s", boundcmd);
+              if (process_command(cmd))
+                return 255;
+              g_free(cmd);
+            } else {
+              scr_LogPrint("Unknown key=%d", key);
+              if (utf8_mode)
+                scr_LogPrint("WARNING: UTF-8 not yet supported!");
+            }
+          }
     }
   }
   if (completion_started && key != 9 && key != KEY_RESIZE)