From e5156fd4c6007cb79c7a1d16b99ca4f48c5bce9e Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 28 Jan 2015 23:17:23 +0100 Subject: [PATCH] Let transfer focus from Board to ICS Input in the input field of the ICS Interaction window transfers focus to the board, but there was no way to transfer focus back without actually typing something in the input field. now does that. Unlike typing printables, it does not close the chat pane, though. In addition, when the chat pane is open now also transfers focus to the board, rather than closing the chat pane. This makes quick transparent switching between board and Chat / ICS Interaction possible. It is no longer possible to simply hide the chat pane, though. But this was usually done for typing a command, and swicthing to the board with and typing the command there has the same effect. --- dialogs.c | 2 ++ gtk/xboard.c | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dialogs.c b/dialogs.c index c58c3d0..f07dcf7 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1901,6 +1901,7 @@ IcsHist (int n, Option *opt, DialogClass dlg) if(opt != &chatOptions[CHAT_IN] && !(opt == &chatOptions[CHAT_PARTNER] && n == 33)) return 0; switch(n) { case 33: // + if(1) BoardToTop(); else if(hidden) BoardToTop(); else PaneSwitch(); break; @@ -2094,6 +2095,7 @@ ChatProc () void ConsoleAutoPopUp (char *buf) { + if(*buf == 27) { if(appData.icsActive && DialogExists(ChatDlg)) HardSetFocus (&chatOptions[CHAT_IN], ChatDlg); return; } if(!appData.autoBox) return; if(appData.icsActive) { // text typed to board in ICS mode: divert to ICS input box if(DialogExists(ChatDlg)) { // box already exists: append to current contents diff --git a/gtk/xboard.c b/gtk/xboard.c index 3588c9d..b2c080c 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1930,7 +1930,7 @@ void MoveTypeInProc(eventkey) buf[0]=eventkey->keyval; buf[1]='\0'; - if (eventkey->keyval > 32 && eventkey->keyval < 256) + if (eventkey->keyval > 32 && eventkey->keyval < 256 || *buf == 27) ConsoleAutoPopUp (buf); } -- 1.7.0.4