some major re-assignment of accelerator keys in the JAWS
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 12 Jul 2009 01:13:50 +0000 (18:13 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 12 Jul 2009 01:13:50 +0000 (18:13 -0700)
winboard/jaws.c
winboard/jaws.rc

index a8555a0..d3856ae 100644 (file)
@@ -153,6 +153,7 @@ VOID SayString(char *mess, BOOL flag)
 static int oldFromX, oldFromY;\r
 static int timeflag;\r
 static int suppressClocks = 0;\r
+static int suppressOneKey = 0;\r
 \r
 BOOL\r
 InitJAWS()\r
@@ -1086,23 +1087,17 @@ NiceTime(int x)
        return (x%3000 == 0);\r
 }\r
 \r
+#if 0\r
+           if(isalpha((char)wParam)) {\r
+               /* capitals of any ind are intercepted and distinguished by left and right shift */\r
+               int mine = GetKeyState(VK_RSHIFT) < 0;\r
+               if(mine || GetKeyState(VK_LSHIFT) < 0) {\r
+#endif\r
+\r
 #define JAWS_ALT_INTERCEPT \\r
-           if(isalpha((char)wParam)) {\\r
-               /* capitals of any ind are intercepted and distinguished by left and right shift */\\r
-               int mine = GetKeyState(VK_RSHIFT) < 0;\\r
-               if(mine || GetKeyState(VK_LSHIFT) < 0) {\\r
-\\r
-                   if(gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) mine = !mine;\\r
-\\r
-                   if(ToLower((char)wParam) == 'x') {\\r
-                       SayPieces(mine ? WhitePlay : BlackPlay);\\r
-                       break;\\r
-                   } else\\r
-                   if(CharToPiece((char)wParam) != EmptySquare) {\\r
-                       SayPieces(CharToPiece(mine ? ToUpper((char)wParam) : ToLower((char)wParam)));\\r
-                       break;\\r
-                   }\\r
-               }\\r
+           if(suppressOneKey) {\\r
+               suppressOneKey = 0;\\r
+               if(GetKeyState(VK_MENU) < 0 && GetKeyState(VK_CONTROL) < 0) break;\\r
            }\\r
            if ((char)wParam == 022 && gameMode == EditPosition) { /* <Ctl R>. Pop up piece menu */\\r
                POINT pt; int x, y;\\r
@@ -1126,6 +1121,30 @@ NiceTime(int x)
 #define JAWS_KB_NAVIGATION \\r
 \\r
        case WM_KEYDOWN:\\r
+\\r
+               if(GetKeyState(VK_MENU) < 0 && GetKeyState(VK_CONTROL) < 0) {\\r
+                   /* Control + Alt + letter used for speaking piece positions */\\r
+                   static int lastTime; static char lastChar;\\r
+                   int mine = 0, time = GetTickCount(); char c;\\r
+\\r
+                   if((char)wParam == lastChar && time-lastTime < 250) mine = 1;\\r
+                   lastChar = wParam; lastTime = time;\\r
+                   c = wParam;\\r
+\\r
+                   if(gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) mine = !mine;\\r
+\\r
+                   if(ToLower(c) == 'x') {\\r
+                       SayPieces(mine ? WhitePlay : BlackPlay);\\r
+                       suppressOneKey = 1;\\r
+                       break;\\r
+                   } else\\r
+                   if(CharToPiece(c) != EmptySquare) {\\r
+                       SayPieces(CharToPiece(mine ? ToUpper(c) : ToLower(c)));\\r
+                       suppressOneKey = 1;\\r
+                       break;\\r
+                   }\\r
+               }\\r
+\\r
                switch (wParam) {\\r
                case VK_LEFT:\\r
                case VK_RIGHT:\\r
index 14e513e..68d9ba9 100644 (file)
@@ -1050,7 +1050,7 @@ BEGIN
     BEGIN\r
         MENUITEM "New &Game\tCtrl-N",           IDM_NewGame\r
         MENUITEM "New Shuffle Game...",         IDM_NewGameFRC\r
-        MENUITEM "New Variant...\tAlt+Ctrl+V",  IDM_NewVariant\r
+        MENUITEM "New Variant...\tAlt+Shift+V",  IDM_NewVariant\r
         MENUITEM SEPARATOR\r
         MENUITEM "&Load Game...\tCtrl-O",       IDM_LoadGame\r
         MENUITEM "Load &Next Game\tAlt+PgDn",   IDM_LoadNextGame\r
@@ -1073,7 +1073,7 @@ BEGIN
         MENUITEM SEPARATOR\r
         MENUITEM "Cop&y Position To Clipboard\tAlt+Shift+C", \r
                                                 IDM_CopyPosition\r
-        MENUITEM "Pas&te Position From Clipboard\tAlt+Shift+V", \r
+        MENUITEM "Pas&te Position From Clipboard\tControl+Shift+V", \r
                                                 IDM_PasteAny\r
         MENUITEM SEPARATOR\r
         MENUITEM "E&xit",                       IDM_Exit\r
@@ -1091,10 +1091,10 @@ BEGIN
         MENUITEM "&Edit Position\tShift+Ctrl+E",IDM_EditPosition\r
         MENUITEM "Trai&ning",                   IDM_Training, GRAYED\r
         MENUITEM SEPARATOR\r
-        MENUITEM "Show Engine &Output\tAlt+Ctrl+O",IDM_ShowEngineOutput\r
-        MENUITEM "Show Evaluation Graph\tAlt+Ctrl+E",IDM_ShowEvalGraph\r
-        MENUITEM "Show Game &List\tAlt+Ctrl+G",  IDM_ShowGameList\r
-        MENUITEM "Show Move History\tAlt+Ctrl+H",IDM_ShowMoveHistory\r
+        MENUITEM "Show Engine &Output\tAlt+Shift+O",IDM_ShowEngineOutput\r
+        MENUITEM "Show Evaluation Graph\tAlt+Shift+E",IDM_ShowEvalGraph\r
+        MENUITEM "Show Game &List\tAlt+Shift+G",  IDM_ShowGameList\r
+        MENUITEM "Show Move History\tAlt+Shift+H",IDM_ShowMoveHistory\r
         MENUITEM SEPARATOR\r
         MENUITEM "Edit &Tags...",               IDM_EditTags\r
         MENUITEM "Edit &Comment...",            IDM_EditComment\r
@@ -1141,17 +1141,17 @@ BEGIN
         MENUITEM SEPARATOR\r
         MENUITEM "&General...",                 IDM_GeneralOptions\r
         MENUITEM "&Board...",                   IDM_BoardOptions\r
-        MENUITEM "Adjudications...\tAlt+Ctrl+J",IDM_EnginePlayOptions\r
-        MENUITEM "Engine Settings...\tAlt+Ctrl+U",IDM_OptionsUCI\r
+        MENUITEM "Adjudications...\tAlt+Shift+J",IDM_EnginePlayOptions\r
+        MENUITEM "Engine Settings...\tAlt+Shift+U",IDM_OptionsUCI\r
         MENUITEM "&ICS...",                     IDM_IcsOptions, GRAYED\r
         MENUITEM "&Fonts...",                   IDM_Fonts\r
         MENUITEM "Soun&ds...",                  IDM_Sounds\r
-        MENUITEM "Game List...\tAlt+Ctrl+G",    IDM_GameListOptions\r
+        MENUITEM "Game List...\tAlt+Shift+G",   IDM_GameListOptions\r
         MENUITEM SEPARATOR\r
         MENUITEM "Comm&unications...",          IDM_CommPort\r
-        MENUITEM "&Load Game...\tAlt+Ctrl+L",   IDM_LoadOptions\r
-        MENUITEM "&Save Game...\tAlt+Ctrl+S",   IDM_SaveOptions\r
-        MENUITEM "&Time Control...\tAlt+Ctrl+T",IDM_TimeControl\r
+        MENUITEM "&Load Game...\tAlt+Shift+L",  IDM_LoadOptions\r
+        MENUITEM "&Save Game...\tAlt+Shift+S",  IDM_SaveOptions\r
+        MENUITEM "&Time Control...\tAlt+Shift+T",IDM_TimeControl\r
         MENUITEM SEPARATOR\r
         MENUITEM "Save Settings &Now",          IDM_SaveSettings\r
         MENUITEM "Save Settings on E&xit",      IDM_SaveSettingsOnExit\r
@@ -1359,7 +1359,7 @@ BEGIN
     "S",            IDM_SaveGame,           VIRTKEY, CONTROL, NOINVERT\r
     "S",            IDM_SavePosition,       VIRTKEY, SHIFT, CONTROL, NOINVERT\r
     "V",            IDM_PasteGame,          VIRTKEY, ALT, NOINVERT\r
-    "V",            IDM_PastePosition,      VIRTKEY, SHIFT, ALT, NOINVERT\r
+    "V",            IDM_PastePosition,      VIRTKEY, SHIFT, CONTROL, NOINVERT\r
     "A",            IDM_PossibleAttackMove, VIRTKEY, ALT, NOINVERT\r
     "D",            IDM_PossibleAttacked,   VIRTKEY, ALT, NOINVERT\r
     "P",            IDM_SayAllBoard,        VIRTKEY, ALT, NOINVERT\r
@@ -1374,17 +1374,17 @@ BEGIN
     "X",            IDM_SayWhosTurn,        VIRTKEY, ALT, NOINVERT\r
     "M",            IDM_SayMachineMove,     VIRTKEY, ALT, NOINVERT\r
     "F",            IDM_ReadColumn,         VIRTKEY, ALT, NOINVERT\r
-    "O",            IDM_ShowEngineOutput,   VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "H",            IDM_ShowMoveHistory,    VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "E",            IDM_ShowEvalGraph,      VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "G",            IDM_ShowGameList,       VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "B",            IDM_BoardOptions,       VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "T",            IDM_TimeControl,        VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "L",            IDM_LoadOptions,        VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "S",            IDM_SaveOptions,        VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "J",            IDM_EnginePlayOptions,  VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "U",            IDM_OptionsUCI,         VIRTKEY, ALT, CONTROL, NOINVERT\r
-    "V",            IDM_NewVariant,         VIRTKEY, ALT, CONTROL, NOINVERT\r
+    "O",            IDM_ShowEngineOutput,   VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "H",            IDM_ShowMoveHistory,    VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "E",            IDM_ShowEvalGraph,      VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "G",            IDM_ShowGameList,       VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "B",            IDM_BoardOptions,       VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "T",            IDM_TimeControl,        VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "L",            IDM_LoadOptions,        VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "S",            IDM_SaveOptions,        VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "J",            IDM_EnginePlayOptions,  VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "U",            IDM_OptionsUCI,         VIRTKEY, ALT, SHIFT, NOINVERT\r
+    "V",            IDM_NewVariant,         VIRTKEY, ALT, SHIFT, NOINVERT\r
     "P",            OPT_PonderNextMove,     VIRTKEY, SHIFT, CONTROL, NOINVERT\r
     "X",            OPT_SaveExtPGN,         VIRTKEY, SHIFT, CONTROL, NOINVERT\r
     "L",            OPT_TestLegality,       VIRTKEY, SHIFT, CONTROL, NOINVERT\r