From 33c2b32d895ba5b4633500928d0b8422e92b1b31 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 10 Dec 2011 11:04:17 -0800 Subject: [PATCH] change keybindings that don't use ctrl, make MoveTypeInProc ctrl aware; fixes #35000 two keybindings were using keys without modifiers, adjusted these to use the ctrl key. Furthermore when typing in moves we need to check if ctrl was pressed and ignore those inputs. Also added documentation for these keybindings. --- xboard.c | 8 ++++---- xboard.texi | 6 ++++++ xoptions.c | 10 ++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/xboard.c b/xboard.c index 68650ab..e2a48f7 100644 --- a/xboard.c +++ b/xboard.c @@ -1108,11 +1108,11 @@ char globalTranslations[] = "\ :F1: ManProc() \n \ :F2: FlipViewProc() \n \ - .: BackwardProc() \n \ - .: ForwardProc() \n \ - Shift1: AskQuestionProc(\"Direct command\",\ + :Ctrl.: BackwardProc() \n \ + :Ctrl.: ForwardProc() \n \ + :Ctrl1: AskQuestionProc(\"Direct command\",\ \"Send to chess program:\",,1) \n \ - Shift2: AskQuestionProc(\"Direct command\",\ + :Ctrl2: AskQuestionProc(\"Direct command\",\ \"Send to second chess program:\",,2) \n"; char boardTranslations[] = diff --git a/xboard.texi b/xboard.texi index 2facc9a..1bf613c 100644 --- a/xboard.texi +++ b/xboard.texi @@ -1582,6 +1582,12 @@ Shows the current XBoard version number. @cindex Keys @cindex Shortcut keys @table @asis +@item Show last move +By hitting @kbd{Ctrl+.} the last move will be re-animated. +@item Send a command directly to the chess engine +Using @kbd{Ctrl+1} a popup window will prompt you for a command that +will be send directly to the first chess engines. @kbd{Ctrl+2} does the +same for a second chess engine, if present. @item Load Next Game @cindex Load Next Game, Menu Item Loads the next game from the last game record file you loaded. diff --git a/xoptions.c b/xoptions.c index 36cf573..60b1a47 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1573,12 +1573,18 @@ void MoveTypeInProc(Widget widget, caddr_t unused, XEvent *event) { char buf[10], keys[32]; KeySym sym; - KeyCode metaL, metaR; + KeyCode metaL, metaR, ctrlL, ctrlR; int n = XLookupString(&(event->xkey), buf, 10, &sym, NULL); XQueryKeymap(xDisplay,keys); metaL = XKeysymToKeycode(xDisplay, XK_Meta_L); metaR = XKeysymToKeycode(xDisplay, XK_Meta_R); - if ( n == 1 && *buf >= 32 && !(keys[metaL>>3]&1<<(metaL&7)) && !(keys[metaR>>3]&1<<(metaR&7))) { // printable, no alt + ctrlL = XKeysymToKeycode(xDisplay, XK_Control_L); + ctrlR = XKeysymToKeycode(xDisplay, XK_Control_R); + if ( n == 1 && *buf >= 32 // printable + && !(keys[metaL>>3]&1<<(metaL&7)) && !(keys[metaR>>3]&1<<(metaR&7)) // no alt key pressed + && !(keys[ctrlL>>3]&1<<(ctrlL&7)) && !(keys[ctrlR>>3]&1<<(ctrlR&7)) // no ctrl key pressed + ) + { if(appData.icsActive) { // text typed to board in ICS mode: divert to ICS input box if(shells[4]) { // box already exists: append to current contents char *p, newText[MSG_SIZ]; -- 1.7.0.4