Page 1 of 3

New XBoard feature: ICS Console

Posted: Mon Feb 03, 2014 8:23 pm
by hgm
I did some experimenting with XBoard, to see if I could improve user interaction with the ICS. Upto now this either was through a terminal window (without separate input field, the output disturbing your typing all the time), or by typing in a small ICS Input Box (that you would easily lose sight of). And then there was a separate Chat Window.

I tried to integrate all that into a single window. (Currently the text still goes to the terminal as well, but you can always minimize that.) In the Xaw version there was no possibility to do line-by-line colorization of text in XBoard dialogs, so the latter could not replace the terminal without loss of functionality. In the GTK version such colorization is possible, though.

So I put an ICS-output text memo to display the colorized text together with a single-line text entry to type commands for the ICS in a single window, similar to WinBoard's ICS Interaction window:


I combined this with the old XBoard Chat window, though: at the top of the window there are 5 buttons, which correspond to 5 chats that you can conduct in parallel. Initially they are not assigned. But when you press them, the output memo is split into two. The upper pane is the shrunk version of the ICS output memo. The lower pane is the output of the selected chat.

Together with the lower pane, a text entry appears, where you can type the player name, channel number or message type (shouts, whispers) to which you want to dedicate this chat. All messages belonging to it will then be diverted to the lower output pane. As long as this pane is shown, the input field will be used for the chat, and what you type there will go to the chat partner. XBoard will automatically prefix it with the required 'tell xxx' or 'shout' commands. To give commands to the ICS you would have to hide the the lower output pane, to which end a 'Hide' button appeared with it.


You can use the buttons at the top of the window to select which chat will be displayed. Activity in non-displayed chats will make the corresponding button turn orange.

The output panes have a context menu: right-clicking on them makes the ICS Text Menu dialog appear. Like with WinBoard, this text menu can now use the word you clicked in the output pane as part of its commands. So you can use it to challenge a specific opponent, or start observing his game. XBoard already had this menu, which could be kept open in an independent window, but you could only use texts in the commands if you first selected them carefully by hand in the terminal. Now you just have to click somewhere, and it will automatically take the corresponding word. If the Text Menu dialog popped up because of your click, it will minimize after you selected a command from it.

The Text Menu can be configured by the user; with the -icsMenu option in the settings file you can create buttons in there of any name, which could send any command you like to the ICS. If the word $name appears in the command, it will be replaced by the clicked word. If the word $input appears in the command, the latter will not be sent immediately to the ICS, but placed in the input field of the ICS Console window for you to finish. (E.g. "tell $name $input") would make "tell playername " appear in the input field when you right-clicked on "playername". When you configured a command "$chat" it will be recognized as a special case, and will assign one of the five chats to the name/number/word you clicked before selecting that command.


This XBoard version is highly experimental; no doubt the Xaw build will be broken, and it can only work for the GTK build. Nevertheless, for the adventurous who would like to try it, the source can be obtained from my repository at:

Feedback is welcome.

Re: New XBoard feature: ICS Console

Posted: Tue Feb 04, 2014 4:52 pm
by mohzus
Hello H.G.M.,
I have downloaded this dev version of xboard (snapshot of the master branch at ... ;a=summary, in other words: ... 8b6;sf=tgz).
I have typed ./, then configured as to compile with the gtk + zippy build, then installed. All went fine.
When I type xboard --version I get xboard version master-20140119; I do not know whether this is normal.

Anyway when on FICS it seems that your "chat box" window is called "ICS Interaction" for me. And the displayed Tabs are "New Chats" in my case (5 such tabs).
I see no colors in text, despite having the option ticked in Option Tab, ICS...
Screenshot attached as usual:

Re: New XBoard feature: ICS Console

Posted: Tue Feb 04, 2014 7:22 pm
by hgm
Well, the texts in your screenshot are not expected to be colored, so this is not really conclusive evidence. Only things like shouts, cshouts, (channel) tells, seek ads and challenges are colored. (And when they are diverted to a chat box, you would not see them in the main console.)

Are the texts colored in your terminal window?

Indeed I changed the window title since I made the screen shots. I just pushed a newer version that uses monospace font in the main console (so lists of players and games won't look so ragged). It also fixes an annoying bug in the scrolling of the main console when you open a chatbox. (Work-around for a GTK bug, really...) It also remembers the window parameters of the chat window in the settings file, so that next time you star XBoard in ICS mode it automatically pops up in the same position as where it was when you closed XBoard.

I also added some key bindings when the ICS input field has focus: <Tab> can be used to switch between chats, or open the first chats. <Esc> is used to close the chat pane (like the Hide button), and when the chat pane was already hidden, transfers focus to the board window. (So you can use the key bindings there, e.g. for Flip View, or offering a draw.) Typing printable characters when the keyboard has focus transfers the focus back to the ICS Input field.

The ICS Text menu now pops up under the mouse pointer, so you can quickly select a command.

Re: New XBoard feature: ICS Console

Posted: Wed Feb 05, 2014 2:55 pm
by mohzus
Thank you H.G.M. Yes the text is colored as it should, sorry.
I really like to use the ICS Interaction to chat in FICS, compared to the terminal. I am already using it and I plan to continue to use it in future.

I wonder if there's a way I can change the background color of the ICS Interaction window (I am not a fan of a white background). I haven't found a way to do that in the ICS... options.

Re: New XBoard feature: ICS Console

Posted: Wed Feb 05, 2014 3:32 pm
by hgm
mohzus wrote:I wonder if there's a way I can change the background color of the ICS Interaction window (I am not a fan of a white background). I haven't found a way to do that in the ICS... options.
You are right: there is no entry 'normal' amongst the text colors in the ICS Options dialog:


The corresponding WinBoard dialog has that (and completely different default colors for all entries). So I guess the back-end code should already have a provision for switching to another color for 'normal' ICS output, and that is just that in the XBoard front-end this is always assumed to be black on white. It should be easy to make that user-configurable too, like all the others. I will see what I can do.

The ,1 as last part of the color definitions (the 'attribute') means 'bold', btw. It is the only attribute I currently implemented. I looked up xterm docs to see how this code would be interpreted, and it seems the only other option would be 4, for 'underline'. I did not implement that yet in the ICS Interaction window. The 'bold' attribute is in general used in cases where the bbackground is darker than the text, so when you plan to do white on black, you should probably make it bold as well to remain clearly readable.

Re: New XBoard feature: ICS Console

Posted: Wed Feb 05, 2014 4:17 pm
by mohzus
I see.
Well while I am at it, let me give 2 suggestions:
1)Being able to "close" a chat window with a particular person. Once you have started to talk with someone, it seems you can't close the window.
2)When you are chatting with a particular person, you can still see/read what happens in channels and shouts, etc. , i.e. just like having the terminal in the background. However you cannot interact, for that matter you have to click on "Hide" first, which hides the conversation you're having with the person and then you can interact with channels, etc.
I suggest a new space at the top of "Hide" for entering commands to interact in channels, shouts, etc.

And report a bug:
When you start a private conversation with a particular person and that this person writes in channels, you won't read his text in channels but they will appear as private messages without any indication that these messages were sent in channels.
This creates a bit of confusion, IMO.

Re: New XBoard feature: ICS Console

Posted: Wed Feb 05, 2014 5:21 pm
by hgm
OK, thanks for your feedback.

You can currently terminate a chat by simply erasing the name of the partner from the Chat Partner field. Normally there would be no reason to do that, unless you run out of chats and want to re-assign it to someone else. In which case you would immediately type another name in the Chat Partner field to replace the old. This would not work when you open a chat by right-clicking the name of the intended partner in the ICS Console, and then selecting "Open Chat with (name)" from the ICS Text Menu that will pop up. In that case, when no empty chats are available, it would always reassign the 5th (rightmost) chat to the clicked name.

I see no other obvious way to decide which chat to replace, when they are all in use. That is, the obvious way would be to replace the one currently displayed. But this seems actually the worst choice, as you wouldn't display it if it wasn't currently active. So to exert any control here you would first have to select the chat you want to replace, and clear the Chat Partner field to make it empty. This would be annoying, as you would likely select it by pressing a button with the mouse, in any case you would have to give the Chat Partner field focus with the mouse, then you would have to switch to the keyboard to erase the contents, and then again to the mouse to click the name of the person you want to open the new chat for.

Would it be an idea to make an 'End Chat' button next to the 'Hide' button that would clear the Chat Partner field? Then you could do it with mouse-only actions: select the chat you want to abandon with a button from the upper row, click 'End Chat' to create an unused chat, and right-click the name of the person you want to open a new chat for.

Perhaps a key binding to open a new chat when there are still unused chats would also be useful (e.g. Ctrl-N). It would do the same thing as pressing the left-most 'New Chat' button.

(2) is a more tricky point. What you describe is in fact how it has been working in WinBoard for years, where the chats are completely independent windows with there own input field. From experience I can say that this is far from ideal. I (and other people too, considering what I see them shout or send to a channel) type things in the wrong field time after time. Just because you forgot which of the two input fields had focus.

I was hoping the design with only a single input field would eventually be more convenient. (But time will have to tell that.) Especially since the field will always be near to the output you are responding to. So it is more obvious to whom you would be typing: the presence of a rather large chat output pane will remind you, where otherwise it would depend on the positioning of a tiny flashing cursor line somewhere.

When you feel the need to respond to something that happened in the ICS Console while you were chatting, all you have to do (in the latest version) is hit <Esc> and the chat hides. This reduces the overhead (which, admittedly, would be large if you had to switch to the mouse to press 'Hide') to almost zero, as you wanted to use the keyboard anyway. Switching to a second input field would be just as bad as having to click 'Hide': in both cases you would have to go to the mouse to click something, while you really wanted to (and were) using the keyboard. When clicking hide the cursor would also return to where you now need to type. A key to switch to a second input field would be the same as <Esc> to hide the chat. The only difference is that while you were typing for the ICS Console, you see non of the chats, rather than just one of the five. (But would there really be people that read there while they were typing?) But you would be informed if something new appeared there by the corresponding button turning orange, and in any case you could immediately re-open the chat window by typing <Tab> after typing the command for the ICS.

I could make it such that typing <Tab> when all chats are hidden would automatically select the chat that was last hidden. (I think now it starts at the left-most in that case.) Then you could type the line intended for the ICS Console by <Esc> ICS command <Tab>. Two extra keys while you were typing is close to the absolute minimum overhead. Perhabs the need for the <Tab> could be removed by automatically switching back to the chat after you terminated the ICS command with <Enter>. But once you start using the ICS Console, I don't see that it would be more likely you wanted to switch back to the chat than to give more ICS commands. So it seems more logical to just stay where you are, rather than automatically switching to something where you might not want to go at all. It seems also easier for the user if what happens when he hits <Enter> does not depend on something that happened (perhaps much) earlier.

What might be a useful addition is a key binding to start a chat with the person or channel that you last received a message from in the ICS Console. Then you would not even have to click his name. Where Ctrl-N would give you a chat with the cursor in an empty Chat Partner field, Ctrl-O (say) could give you a chat with that last-active player/channel/shout/whisper in the ICS Console pane in the Chat Partner field, the cursor remaining in the input field.

Re: New XBoard feature: ICS Console

Posted: Wed Feb 05, 2014 11:21 pm
by hgm
OK, the new version in the repository now does most of the above:

Ctrl-N: opens new empty chat (if available)
Ctrl-O: opens private chat box for the sender of the latest message received in the ICS Console pane
<Tab>: now preferentially opens the chat that was active when chats were hidden (but chats where there is yet-unseen activity will still have priority)

I added the End-Chat button. This clears the chat contents and chat-partner field, but it does not switch to another chat, because it assumes you now want to reassign this chat to another partner.

When a person's message goes to a 'collective broadcast' like shouts, whispers or a channel, it is now also displayed in the private chat box for that person, if there is one.

Known bugs:
* Typing <Esc> in the chat-partner field closes the ICS window.
* The Text Menu pops up in the wrong place when you click in the chat pane rather than the ICS output pane.
* The End-Chat button does not immediately turn the text on the corresponding chat button into 'New Chat'
* Not-yet-sent lines in the input field get lost when changing chats.

Re: New XBoard feature: ICS Console

Posted: Thu Feb 06, 2014 1:14 pm
by mohzus
First of all, thank you very much again.
hgm wrote: You can currently terminate a chat by simply erasing the name of the partner from the Chat Partner field. Normally there would be no reason to do that, unless you run out of chats and want to re-assign it to someone else.
Yes exactly, especially if some of the people are gone; I think it's a fair reason to want to remove those chat boxes (manually of course).
I will test the latest version with the new button implemented.

Re: New XBoard feature: ICS Console

Posted: Thu Feb 06, 2014 1:43 pm
by mohzus
Oops I forgot to insist: What about the non ability to know whether someone is talking to you or in a channel, granted you have a private conversation with him? The text of that person will always appear in the chat box, regardless if it has been posted in a channel.