From fd5232356b95d30941de9dfd49444a1953eaa38a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 5 Feb 2014 21:59:10 +0100 Subject: [PATCH] Ctrl-N in chat opens empty chat This key isequivalent to pressing the left-most New Chat button. If no unused chat present, it the command will be ignored. --- dialogs.c | 4 ++++ gtk/xoptions.c | 1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dialogs.c b/dialogs.c index 91d752b..a2cd3c5 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1796,6 +1796,10 @@ IcsHist (int n, Option *opt, DialogClass dlg) if(hidden) BoardToTop(); else PaneSwitch(); break; + case 14: + for(chat=0; chat < MAX_CHAT; chat++) if(!chatPartner[chat][0]) break; + if(chat < MAX_CHAT) ChatSwitch(chat + 1); + break; case 10: // chat = start = (activePartner - hidden + MAX_CHAT) % MAX_CHAT; while(!dirty[chat = (chat + 1)%MAX_CHAT]) if(chat == start) break; diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 2806fb0..f330e41 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -503,6 +503,7 @@ TypeInProc (GtkWidget *widget, GdkEventKey *event, gpointer gdata) shiftState = event->state & GDK_SHIFT_MASK; controlState = event->state & GDK_CONTROL_MASK; switch(event->keyval) { + case 'n': return (controlState && IcsHist(14, opt, dlg)); case GDK_Tab: IcsHist(10, opt, dlg); break; case GDK_Up: IcsHist(1, opt, dlg); break; case GDK_Down: IcsHist(-1, opt, dlg); break; -- 1.7.0.4