From 3da89424edf2ed3fa8d149868135a21135ea9b11 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 20 Sep 2017 12:08:46 +0700 Subject: [PATCH] Cleanup of dev-time install and debugging, removal of commented code --- windows/src/Defines.mak | 6 +++--- windows/src/desktop/kmshell/Makefile | 4 ++-- windows/src/developer/TIKE/Makefile | 2 +- windows/src/developer/kmcmpdll/Makefile | 2 +- windows/src/developer/kmcomp/Makefile | 2 +- windows/src/engine/keyman/Makefile | 4 ++-- windows/src/engine/keyman32/K32_DBG.CPP | 15 +++++++-------- windows/src/engine/keyman32/Makefile | 2 +- windows/src/engine/keyman32/capsstate.cpp | 8 -------- windows/src/engine/keyman64/Makefile | 2 +- windows/src/engine/keymanx64/Makefile | 2 +- windows/src/engine/kmcomapi/Makefile | 6 +++--- windows/src/engine/kmtip/Makefile | 10 ++-------- windows/src/engine/mcompile/Makefile | 2 +- windows/src/engine/tsysinfo/Makefile | 4 ++-- windows/src/global/vc/keynames.cpp | 14 ++++++++------ 16 files changed, 36 insertions(+), 49 deletions(-) diff --git a/windows/src/Defines.mak b/windows/src/Defines.mak index 818754d649..f88d4b34f5 100644 --- a/windows/src/Defines.mak +++ b/windows/src/Defines.mak @@ -25,9 +25,9 @@ BUILD=$(ROOT)\build DEBUGPATH=$(ROOT)\debug OUTLIB=$(ROOT)\lib -INSTALLPATH_KEYMANDESKTOP="%ProgramFiles(X86)%\Keyman\Keyman Desktop 10.0" -INSTALLPATH_KEYMANDEVELOPER="%ProgramFiles(X86)%\Keyman\Keyman Developer 10.0" -INSTALLPATH_KEYMANENGINE="%CommonProgramFiles(X86)%\Keyman\Keyman Engine 10.0" +INSTALLPATH_KEYMANDESKTOP=%ProgramFiles(X86)%\Keyman\Keyman Desktop 10.0 +INSTALLPATH_KEYMANDEVELOPER=%ProgramFiles(X86)%\Keyman\Keyman Developer 10.0 +INSTALLPATH_KEYMANENGINE=%CommonProgramFiles(X86)%\Keyman\Keyman Engine 10.0 !IFDEF DEBUG MAKEFLAG_DEBUG=-DDEBUG diff --git a/windows/src/desktop/kmshell/Makefile b/windows/src/desktop/kmshell/Makefile index 6b4b9b62f1..ebf50148b8 100644 --- a/windows/src/desktop/kmshell/Makefile +++ b/windows/src/desktop/kmshell/Makefile @@ -36,7 +36,7 @@ test-manifest: $(MT) -nologo -inputresource:$(PROGRAM)\desktop\kmshell.exe -validate_manifest install: - copy $(ROOT)\bin\desktop\kmshell.exe $(INSTALLPATH_KEYMANDESKTOP) - copy $(ROOT)\bin\desktop\xml\* $(INSTALLPATH_KEYMANDESKTOP)\xml\ + copy $(ROOT)\bin\desktop\kmshell.exe "$(INSTALLPATH_KEYMANDESKTOP)" + copy $(ROOT)\bin\desktop\xml\* "$(INSTALLPATH_KEYMANDESKTOP)\xml\" !include ..\..\Target.mak diff --git a/windows/src/developer/TIKE/Makefile b/windows/src/developer/TIKE/Makefile index 8f28225bb3..35f5ac7585 100644 --- a/windows/src/developer/TIKE/Makefile +++ b/windows/src/developer/TIKE/Makefile @@ -40,7 +40,7 @@ backup: install: - $(COPY) $(PROGRAM)\developer\tike.exe $(INSTALLPATH_KEYMANDEVELOPER)\tike.exe + $(COPY) $(PROGRAM)\developer\tike.exe "$(INSTALLPATH_KEYMANDEVELOPER)\tike.exe" test-manifest: # test that linked manifest exists and correct diff --git a/windows/src/developer/kmcmpdll/Makefile b/windows/src/developer/kmcmpdll/Makefile index f2bff68dc8..3d667a8e79 100644 --- a/windows/src/developer/kmcmpdll/Makefile +++ b/windows/src/developer/kmcmpdll/Makefile @@ -24,6 +24,6 @@ test-manifest: @rem This target needed as dependency for TIKE and KMCMPDLL install: - $(COPY) $(PROGRAM)\developer\kmcmpdll.dll $(INSTALLPATH_KEYMANDEVELOPER)\kmcmpdll.dll + $(COPY) $(PROGRAM)\developer\kmcmpdll.dll "$(INSTALLPATH_KEYMANDEVELOPER)\kmcmpdll.dll" !include ..\..\Target.mak diff --git a/windows/src/developer/kmcomp/Makefile b/windows/src/developer/kmcomp/Makefile index 4b5b1c2897..29b3afe3c1 100644 --- a/windows/src/developer/kmcomp/Makefile +++ b/windows/src/developer/kmcomp/Makefile @@ -28,6 +28,6 @@ test-manifest: $(MT) -nologo -inputresource:$(PROGRAM)\developer\kmcomp.exe -validate_manifest install: - $(COPY) $(PROGRAM)\developer\kmcomp.exe $(INSTALLPATH_KEYMANDEVELOPER)\kmcomp.exe + $(COPY) $(PROGRAM)\developer\kmcomp.exe "$(INSTALLPATH_KEYMANDEVELOPER)\kmcomp.exe" !include ..\..\Target.mak diff --git a/windows/src/engine/keyman/Makefile b/windows/src/engine/keyman/Makefile index 4e291b73b1..56b35f330c 100644 --- a/windows/src/engine/keyman/Makefile +++ b/windows/src/engine/keyman/Makefile @@ -37,8 +37,8 @@ debug-manifest: copy std-manifest.xml manifest.xml install: - $(COPY) $(PROGRAM)\engine\keyman.exe $(INSTALLPATH_KEYMANENGINE) - $(COPY) keyman.rsm $(INSTALLPATH_KEYMANENGINE) + $(COPY) $(PROGRAM)\engine\keyman.exe "$(INSTALLPATH_KEYMANENGINE)" + $(COPY) keyman.rsm "$(INSTALLPATH_KEYMANENGINE)" test-uiaccess: grep -c "uiAccess=\"true\"" manifest.xml diff --git a/windows/src/engine/keyman32/K32_DBG.CPP b/windows/src/engine/keyman32/K32_DBG.CPP index a181fca7a0..3000729a96 100644 --- a/windows/src/engine/keyman32/K32_DBG.CPP +++ b/windows/src/engine/keyman32/K32_DBG.CPP @@ -402,17 +402,16 @@ void DebugMessage(LPMSG msg, WPARAM wParam) // I2908 char ds[256]; if(msg->message == wm_keymankeydown) - wsprintf(ds, "DebugMessage(%x, wm_keymankeydown: %s %x lParam: %X) [message flags: %x time: %d]", msg->hwnd, - msg->wParam < 256 ? KeyNames[msg->wParam] : "???", msg->wParam, msg->lParam, wParam, msg->time); + wsprintf(ds, "DebugMessage(%x, wm_keymankeydown: %s lParam: %X) [message flags: %x time: %d]", msg->hwnd, + Debug_VirtualKey((WORD) msg->wParam), msg->lParam, wParam, msg->time); else if(msg->message == wm_keymankeyup) - wsprintf(ds, "DebugMessage(%x, wm_keymankeyup: %s %d lParam: %X) [message flags: %x time: %d]", msg->hwnd, - msg->wParam < 256 ? KeyNames[msg->wParam] : "???", msg->wParam, msg->lParam, wParam, msg->time); + wsprintf(ds, "DebugMessage(%x, wm_keymankeyup: %s lParam: %X) [message flags: %x time: %d]", msg->hwnd, + Debug_VirtualKey((WORD) msg->wParam), msg->lParam, wParam, msg->time); else if(msg->message == WM_KEYDOWN || msg->message == WM_KEYUP || msg->message == WM_SYSKEYDOWN || msg->message == WM_SYSKEYUP) - wsprintf(ds, "DebugMessage(%x, %s, wParam: '%s' (%d), lParam: %X) [message flags: %x time: %d extra: %x]", + wsprintf(ds, "DebugMessage(%x, %s, wParam: %s, lParam: %X) [message flags: %x time: %d extra: %x]", msg->hwnd, msgnames[msg->message-WM_KEYDOWN], - (msg->wParam < 256 ? KeyNames[msg->wParam] : "???"), - msg->wParam, + Debug_VirtualKey((WORD) msg->wParam), msg->lParam, wParam, msg->time, @@ -479,7 +478,7 @@ char *Debug_VirtualKey(WORD vk) { return ""; } - if (vk < 255) { + if (vk < 256) { wsprintf(buf, "['%s' 0x%x]", KeyNames[vk], vk); } else { diff --git a/windows/src/engine/keyman32/Makefile b/windows/src/engine/keyman32/Makefile index 0be75a5ce4..6747f38b80 100644 --- a/windows/src/engine/keyman32/Makefile +++ b/windows/src/engine/keyman32/Makefile @@ -25,6 +25,6 @@ backup: $(WZZIP) $(BUILD)\engine\keyman32.zip $(BACKUPDEFAULTS) keyman32.dll install: - $(COPY) $(PROGRAM)\engine\keyman32.dll $(INSTALLPATH_KEYMANENGINE)\keyman32.dll + $(COPY) $(PROGRAM)\engine\keyman32.dll "$(INSTALLPATH_KEYMANENGINE)\keyman32.dll" !include ..\..\Target.mak diff --git a/windows/src/engine/keyman32/capsstate.cpp b/windows/src/engine/keyman32/capsstate.cpp index 874164d08c..2eb7b92570 100644 --- a/windows/src/engine/keyman32/capsstate.cpp +++ b/windows/src/engine/keyman32/capsstate.cpp @@ -65,7 +65,6 @@ void KeyCapsLockPress(BOOL FIsUp) // I3284 - void // I3529 { if(FIsUp && !(GetKeyState(VK_CAPITAL) & 1)) // I267 - 24/11/2006 invert GetKeyState test { - //*Globals::ShiftState() |= CAPITALFLAG; // I4548 keybd_event(VK_CAPITAL, 0xFF, 0, 0); keybd_event(VK_CAPITAL, 0xFF, KEYEVENTF_KEYUP, 0); } @@ -74,8 +73,6 @@ void KeyCapsLockPress(BOOL FIsUp) // I3284 - void // I3529 { if(!FIsUp && (GetKeyState(VK_CAPITAL) & 1)) { // I267 - 24/11/2006 invert GetKeyState test - //FShouldIgnoreNextKey[vkKey] = 2; // KEY DOWN AND THEN UP - //*Globals::ShiftState() &= ~CAPITALFLAG; // I4548 keybd_event(VK_CAPITAL, 0xFF, KEYEVENTF_KEYUP, 0); keybd_event(VK_CAPITAL, 0xFF, 0, 0); } @@ -93,15 +90,10 @@ void KeyShiftPress(BOOL FIsUp) // I3284 - void // I3529 if(_td->lpActiveKeyboard->Keyboard->dwFlags & KF_SHIFTFREESCAPS) { - //SendDebugMessageFormat(0, sdmDebug, 0, "KeyShiftPress -- KF_SHIFTFRESSCAPS [%s]", FIsUp ? "up" : "down"); if(!FIsUp) { - //*Globals::IgnoreNextCaps() += 2; - //keybd_event(VK_SHIFT, 0xFF, KEYEVENTF_KEYUP, 0); - //*Globals::ShiftState() &= ~CAPITALFLAG; // I4548 keybd_event(VK_CAPITAL, 0xFF, 0, 0); keybd_event(VK_CAPITAL, 0xFF, KEYEVENTF_KEYUP, 0); - //keybd_event(VK_SHIFT, 0xFF, 0, 0); } } } diff --git a/windows/src/engine/keyman64/Makefile b/windows/src/engine/keyman64/Makefile index 4af3309f7d..5597da5dbf 100644 --- a/windows/src/engine/keyman64/Makefile +++ b/windows/src/engine/keyman64/Makefile @@ -25,6 +25,6 @@ backup: $(WZZIP) $(BUILD)\engine\keyman64.zip $(BACKUPDEFAULTS) keyman64.dll install: - $(COPY) $(PROGRAM)\engine\keyman64.dll $(INSTALLPATH_KEYMANENGINE)\keyman64.dll + $(COPY) $(PROGRAM)\engine\keyman64.dll "$(INSTALLPATH_KEYMANENGINE)\keyman64.dll" !include ..\..\Target.mak diff --git a/windows/src/engine/keymanx64/Makefile b/windows/src/engine/keymanx64/Makefile index ee5e2ec000..98bcd4dd7f 100644 --- a/windows/src/engine/keymanx64/Makefile +++ b/windows/src/engine/keymanx64/Makefile @@ -26,7 +26,7 @@ backup: $(WZZIP) $(BUILD)\engine\keymanx64.exe $(BACKUPDEFAULTS) keymanx64.exe install: - $(COPY) $(PROGRAM)\engine\keymanx64.exe $(INSTALLPATH_KEYMANENGINE) + $(COPY) $(PROGRAM)\engine\keymanx64.exe "$(INSTALLPATH_KEYMANENGINE)" test-uiaccess: grep -c "uiAccess=\"true\"" manifest.xml diff --git a/windows/src/engine/kmcomapi/Makefile b/windows/src/engine/kmcomapi/Makefile index 7988940f2b..548ebfc66f 100644 --- a/windows/src/engine/kmcomapi/Makefile +++ b/windows/src/engine/kmcomapi/Makefile @@ -23,9 +23,9 @@ signcode: $(SIGNCODE) /d "Keyman Engine" $(PROGRAM)\engine\kmcomapi.dll install: - regsvr32 /s /u $(INSTALLPATH_KEYMANENGINE)\kmcomapi.dll - $(COPY) $(PROGRAM)\engine\kmcomapi.dll $(INSTALLPATH_KEYMANENGINE) - regsvr32 $(INSTALLPATH_KEYMANENGINE)\kmcomapi.dll + cmd /c regsvr32 /s /u "$(INSTALLPATH_KEYMANENGINE)\kmcomapi.dll" + $(COPY) $(PROGRAM)\engine\kmcomapi.dll "$(INSTALLPATH_KEYMANENGINE)" + cmd /c regsvr32 /s "$(INSTALLPATH_KEYMANENGINE)\kmcomapi.dll" backup: $(WZZIP) $(BUILD)\engine\kmcomapi.zip $(BACKUPDEFAULTS) kmcomapi.dll diff --git a/windows/src/engine/kmtip/Makefile b/windows/src/engine/kmtip/Makefile index a797e67d1c..001e074dfc 100644 --- a/windows/src/engine/kmtip/Makefile +++ b/windows/src/engine/kmtip/Makefile @@ -25,13 +25,7 @@ backup: $(WZZIP) $(BUILD)\engine\kmtip64.zip x64\kmtip64.pdb $(BACKUPDEFAULTS) x64\kmtip64.dll install: - cd $(INSTALLPATH_KEYMANENGINE) - #regsvr32 /s /u kmtip.dll - #regsvr32 /s /u kmtip64.dll - $(COPY) $(PROGRAM)\engine\kmtip.dll $(INSTALLPATH_KEYMANENGINE)\kmtip.dll - $(COPY) $(PROGRAM)\engine\kmtip64.dll $(INSTALLPATH_KEYMANENGINE)\kmtip64.dll - #regsvr32 /s kmtip.dll - #regsvr32 /s kmtip64.dll - cd $(ROOT)\src\engine\kmtip + $(COPY) $(PROGRAM)\engine\kmtip.dll "$(INSTALLPATH_KEYMANENGINE)\kmtip.dll" + $(COPY) $(PROGRAM)\engine\kmtip64.dll "$(INSTALLPATH_KEYMANENGINE)\kmtip64.dll" !include ..\..\Target.mak diff --git a/windows/src/engine/mcompile/Makefile b/windows/src/engine/mcompile/Makefile index 84260e52bb..882d878bc6 100644 --- a/windows/src/engine/mcompile/Makefile +++ b/windows/src/engine/mcompile/Makefile @@ -22,7 +22,7 @@ backup: $(WZZIP) $(BUILD)\engine\mcompile.exe $(BACKUPDEFAULTS) mcompile.exe install: - $(COPY) $(PROGRAM)\engine\mcompile.exe $(INSTALLPATH_KEYMANENGINE) + $(COPY) $(PROGRAM)\engine\mcompile.exe "$(INSTALLPATH_KEYMANENGINE)" test-manifest: # test that linked manifest exists and correct diff --git a/windows/src/engine/tsysinfo/Makefile b/windows/src/engine/tsysinfo/Makefile index d698c9becf..fdc0a42919 100644 --- a/windows/src/engine/tsysinfo/Makefile +++ b/windows/src/engine/tsysinfo/Makefile @@ -32,8 +32,8 @@ backup: $(WZZIP) $(BUILD)\engine\tsysinfo.zip $(BACKUPDEFAULTS) tsysinfo.exe install: - $(COPY) $(PROGRAM)\engine\tsysinfo.exe $(INSTALLPATH_KEYMANENGINE) - $(COPY) $(ROOT)\src\engine\tsysinfo\*.xsl $(INSTALLPATH_KEYMANENGINE) + $(COPY) $(PROGRAM)\engine\tsysinfo.exe "$(INSTALLPATH_KEYMANENGINE)" + $(COPY) $(ROOT)\src\engine\tsysinfo\*.xsl "$(INSTALLPATH_KEYMANENGINE)" test-manifest: # test that linked manifest exists and correct diff --git a/windows/src/global/vc/keynames.cpp b/windows/src/global/vc/keynames.cpp index 61a242a2ee..a11e851914 100644 --- a/windows/src/global/vc/keynames.cpp +++ b/windows/src/global/vc/keynames.cpp @@ -166,12 +166,14 @@ LPSTR KeyNames[256] = { "?9D", // &H9D "?9E", // &H9E "?9F", // &H9F - "?A0", // &HA0 - "?A1", // &HA1 - "?A2", // &HA2 - "?A3", // &HA3 - "?A4", // &HA4 - "?A5", // &HA5 + + "?LShift", // &HA0 + "?RShift", // &HA1 + "?LControl", // &HA2 + "?RControl", // &HA3 + "?LAlt", // &HA4 + "?RAlt", // &HA5 + "?A6", // &HA6 "?A7", // &HA7 "?A8", // &HA8