Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00966549d8 | ||
|
|
783a6d69af | ||
|
|
4cd127a597 |
No files matched your search
+5
-2
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(KSwitcher VERSION 0.6.129 LANGUAGES CXX RC)
|
||||
project(KSwitcher VERSION 0.6.130 LANGUAGES CXX RC)
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "KSwitcher uses native Windows APIs")
|
||||
endif()
|
||||
@@ -52,7 +52,10 @@ target_link_libraries(KSwitcherFiles PRIVATE kscore)
|
||||
target_include_directories(kscore PUBLIC src PRIVATE vendor)
|
||||
target_compile_definitions(kscore PUBLIC UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX _WIN32_WINNT=0x0A00)
|
||||
target_link_libraries(kscore PUBLIC ws2_32 bcrypt iphlpapi winhttp user32 shell32 shlwapi advapi32 crypt32 imm32 comctl32 gdi32 ole32 oleaut32 taskschd comdlg32 uuid windowscodecs runtimeobject uiautomationcore)
|
||||
set_property(SOURCE resources/app.rc APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/resources/update.ps1")
|
||||
set_property(SOURCE resources/app.rc APPEND PROPERTY OBJECT_DEPENDS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/resources/update.ps1"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/resources/kswitcher.ico"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/resources/kswitcher-paused.ico")
|
||||
add_executable(KSwitcher WIN32 src/main.cpp src/app.cpp src/screenshot_notifications.cpp src/screenshot_launcher.cpp src/screenshot_activation.cpp src/configuration.cpp src/ui.cpp resources/app.rc)
|
||||
target_compile_definitions(KSwitcher PRIVATE KS_RESIDENT_APP)
|
||||
target_link_libraries(KSwitcher PRIVATE kscore)
|
||||
|
||||
@@ -204,7 +204,7 @@ physical key positions and therefore reset recent-word tracking; selection conve
|
||||
### Pause input processing
|
||||
|
||||
Right-click the KSwitcher tray icon and choose **Pause input processing** before testing another keyboard tool.
|
||||
The icon shows a gray dot and the tooltip says **Input processing paused**. KSwitcher releases its shortcuts and
|
||||
The purple **K** changes to two white pause bars on a gray tile. The tooltip says **Input processing paused** once KSwitcher releases its shortcuts and
|
||||
stops keyboard and mouse actions, autocorrection, snippets, automatic layout switching, LAN mouse and keyboard
|
||||
control, and simulated F15 activity. Clipboard history has its own pause control. You can browse entries
|
||||
during an input pause and paste them after resuming. If you launched the standalone **StayHere** utility,
|
||||
@@ -215,7 +215,7 @@ KSwitcher identifies the combination and stays paused. Release it in the other p
|
||||
The pause lasts for the current run.
|
||||
|
||||
**Українською.** Перед тестуванням іншої програми клацни правою кнопкою значок KSwitcher у треї й вибери
|
||||
**Pause input processing**. Сіра крапка та підказка **Input processing paused** позначають паузу. KSwitcher
|
||||
**Pause input processing**. Фіолетова **K** зміниться на дві білі смуги на сірому тлі. Підказка **Input processing paused** підтвердить паузу. KSwitcher
|
||||
звільняє гарячі клавіші й призупиняє дії клавіатури та миші, автокорекцію, сніпети, автоматичне перемикання
|
||||
розкладки, LAN-керування й імітацію F15. Історія буфера обміну має окремий перемикач. Записи можна переглядати
|
||||
під час паузи та вставляти після відновлення. Якщо окремо запущена утиліта **StayHere**, її імітація F15
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Latest Windows release
|
||||
|
||||
## v0.6.130 — 2026-11-22
|
||||
|
||||
The tray shows a purple **K** while KSwitcher processes input. Choose **Pause input processing** to see two white pause bars on a gray tile. The purple **K** returns after **Resume input processing** succeeds. If another program still holds a shortcut, the pause bars stay visible.
|
||||
|
||||
**Українською.**
|
||||
|
||||
Фіолетова **K** у треї означає, що KSwitcher обробляє введення. Після вибору **Pause input processing** з’являються дві білі смуги на сірому тлі. Фіолетова **K** повертається після успішного **Resume input processing**. Якщо інша програма ще утримує гарячу клавішу, значок паузи залишається.
|
||||
|
||||
## v0.6.129 — 2026-11-22
|
||||
|
||||
Choose **Pause input processing** in the tray to test another keyboard tool. The tooltip shows **Input processing paused** once KSwitcher releases its shortcuts and stops keyboard and mouse actions, snippets, autocorrection, automatic layout switching, LAN input and simulated F15 activity. Clipboard history can still record entries. Choose **Resume input processing** to restore input. If a shortcut is occupied, KSwitcher names it and stays paused until you retry. Restarting KSwitcher also clears the pause.
|
||||
|
||||
@@ -1 +1 @@
|
||||
6b0235bfb3714c8a4d4fc348bfe40590b230a74dfea31ced6d868830163f9684 KSwitcher-win-x64.zip
|
||||
28f0dc723444344dbc9bf363077c0e7d00a6089e714f8937b096c29c55db6a01 KSwitcher-win-x64.zip
|
||||
+66
-66
@@ -1,166 +1,166 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"files": [
|
||||
{
|
||||
"sha256": "364ce89ce3aec6dec8b5afbf2130ded43f661ad5270c58509f636fdfcb750992",
|
||||
"path": "KSwitcher.exe",
|
||||
"size": 2496000
|
||||
"size": 2508800,
|
||||
"sha256": "bacf777a44cc1859fcdc07f411f18f065801ed07c6673719f177ae72f4247c0e"
|
||||
},
|
||||
{
|
||||
"sha256": "167f997ffc385732bb95e058f948646c0a0d75e17e4496538b0da96710a65ca2",
|
||||
"path": "KSwitcher.Config.exe",
|
||||
"size": 2464768
|
||||
"size": 2478080,
|
||||
"sha256": "1b072b84be7e862ef94271bc300908f8e0525c57890867d21bca3d2a396252d8"
|
||||
},
|
||||
{
|
||||
"sha256": "376d042d0e13c924cedd19a617f0310af44e7a88fcc2912e570b82f853bb73fb",
|
||||
"path": "KSwitcher.Screenshot.exe",
|
||||
"size": 3063808
|
||||
"size": 3077120,
|
||||
"sha256": "088a4db4035c15393c908271d80897bdb19da3405c28f4b7ec8af9829895a569"
|
||||
},
|
||||
{
|
||||
"sha256": "8bdadced6637c9536d26fb2f2d66b45655e1970b4ab8e4ad7660eedaf0cf59fe",
|
||||
"path": "KSwitcher.Files.exe",
|
||||
"size": 4377600
|
||||
"size": 4377600,
|
||||
"sha256": "6dace995d53dff51d0b752a5327092346f8be4b4801ccf12db38e3cc9e30e5ce"
|
||||
},
|
||||
{
|
||||
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6",
|
||||
"path": "WebView2Loader.dll",
|
||||
"size": 194912
|
||||
"size": 194912,
|
||||
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6"
|
||||
},
|
||||
{
|
||||
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f",
|
||||
"path": "terminal/addon-fit-LICENSE.txt",
|
||||
"size": 1103
|
||||
"size": 1103,
|
||||
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f"
|
||||
},
|
||||
{
|
||||
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527",
|
||||
"path": "terminal/addon-fit.js",
|
||||
"size": 1521
|
||||
"size": 1521,
|
||||
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527"
|
||||
},
|
||||
{
|
||||
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef",
|
||||
"path": "terminal/index.html",
|
||||
"size": 527
|
||||
"size": 527,
|
||||
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef"
|
||||
},
|
||||
{
|
||||
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473",
|
||||
"path": "terminal/markdown-it-LICENSE.txt",
|
||||
"size": 1073
|
||||
"size": 1073,
|
||||
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473"
|
||||
},
|
||||
{
|
||||
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e",
|
||||
"path": "terminal/markdown-it.js",
|
||||
"size": 100786
|
||||
"size": 100786,
|
||||
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e"
|
||||
},
|
||||
{
|
||||
"sha256": "b83ae50c2ada2aa6efcb02016ab54461fc9de5653111f976a51945ee0afd2094",
|
||||
"path": "terminal/markdown.html",
|
||||
"size": 3599
|
||||
"size": 3599,
|
||||
"sha256": "b83ae50c2ada2aa6efcb02016ab54461fc9de5653111f976a51945ee0afd2094"
|
||||
},
|
||||
{
|
||||
"sha256": "9a48dc026dbd3970a88c34775836534d795b90765a381fce3f2a7be9640d44c8",
|
||||
"path": "terminal/markdown.js",
|
||||
"size": 17575
|
||||
"size": 17575,
|
||||
"sha256": "9a48dc026dbd3970a88c34775836534d795b90765a381fce3f2a7be9640d44c8"
|
||||
},
|
||||
{
|
||||
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80",
|
||||
"path": "terminal/mermaid-LICENSE.txt",
|
||||
"size": 1089
|
||||
"size": 1089,
|
||||
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80"
|
||||
},
|
||||
{
|
||||
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3",
|
||||
"path": "terminal/mermaid.js",
|
||||
"size": 5537838
|
||||
"size": 5537838,
|
||||
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3"
|
||||
},
|
||||
{
|
||||
"sha256": "8268049507da54079422db2b4d90b41cd0a1e99b5946b675173ea3543de27f0b",
|
||||
"path": "terminal/terminal.js",
|
||||
"size": 5065
|
||||
"size": 5065,
|
||||
"sha256": "8268049507da54079422db2b4d90b41cd0a1e99b5946b675173ea3543de27f0b"
|
||||
},
|
||||
{
|
||||
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd",
|
||||
"path": "terminal/xterm-LICENSE.txt",
|
||||
"size": 1261
|
||||
"size": 1261,
|
||||
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd"
|
||||
},
|
||||
{
|
||||
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6",
|
||||
"path": "terminal/xterm.css",
|
||||
"size": 7112
|
||||
"size": 7112,
|
||||
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6"
|
||||
},
|
||||
{
|
||||
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972",
|
||||
"path": "terminal/xterm.js",
|
||||
"size": 488663
|
||||
"size": 488663,
|
||||
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972"
|
||||
},
|
||||
{
|
||||
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c",
|
||||
"path": "LICENSE",
|
||||
"size": 4401
|
||||
"size": 4401,
|
||||
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c"
|
||||
},
|
||||
{
|
||||
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831",
|
||||
"path": "json-LICENSE.txt",
|
||||
"size": 1096
|
||||
"size": 1096,
|
||||
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831"
|
||||
},
|
||||
{
|
||||
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625",
|
||||
"path": "files-text-license.txt",
|
||||
"size": 883
|
||||
"size": 883,
|
||||
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625"
|
||||
},
|
||||
{
|
||||
"sha256": "39625f7405b2eec379bb93d06f97c4f380527d974a8891581bf753b7b29af6d6",
|
||||
"path": "README.md",
|
||||
"size": 101736
|
||||
"size": 101852,
|
||||
"sha256": "e180efa5da9672111d8649422b661f55c85f33e458aba9e1b95060ea7c95ebe2"
|
||||
},
|
||||
{
|
||||
"sha256": "3ab51025826e8aa2f7c07b70b920b556409b002029b4bb92cb34c5b32dac6e54",
|
||||
"path": "LAN-PREVIEW.md",
|
||||
"size": 12353
|
||||
"size": 12353,
|
||||
"sha256": "3ab51025826e8aa2f7c07b70b920b556409b002029b4bb92cb34c5b32dac6e54"
|
||||
},
|
||||
{
|
||||
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9",
|
||||
"path": "dictionaries/en.txt",
|
||||
"size": 732485
|
||||
"size": 732485,
|
||||
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9"
|
||||
},
|
||||
{
|
||||
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5",
|
||||
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
|
||||
"size": 20566
|
||||
"size": 20566,
|
||||
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5"
|
||||
},
|
||||
{
|
||||
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311",
|
||||
"path": "dictionaries/README.md",
|
||||
"size": 2265
|
||||
"size": 2265,
|
||||
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311"
|
||||
},
|
||||
{
|
||||
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849",
|
||||
"path": "dictionaries/ru.txt",
|
||||
"size": 1109134
|
||||
"size": 1109134,
|
||||
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849"
|
||||
},
|
||||
{
|
||||
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408",
|
||||
"path": "dictionaries/sources.json",
|
||||
"size": 1280
|
||||
"size": 1280,
|
||||
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408"
|
||||
},
|
||||
{
|
||||
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf",
|
||||
"path": "dictionaries/uk.txt",
|
||||
"size": 940799
|
||||
"size": 940799,
|
||||
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf"
|
||||
},
|
||||
{
|
||||
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a",
|
||||
"path": "tools/README.txt",
|
||||
"size": 993
|
||||
"size": 993,
|
||||
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a"
|
||||
},
|
||||
{
|
||||
"sha256": "51f023c7391129c7943b9be9388b6a730def4717b782b2a317f11bcf44c6c22a",
|
||||
"path": "tools/StayHere.exe",
|
||||
"size": 133120
|
||||
"size": 133120,
|
||||
"sha256": "d18778c437b3dda8258babb9db48a94d275fbe7272241f08e0da96173595abd9"
|
||||
},
|
||||
{
|
||||
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413",
|
||||
"path": "tools/StayHere-README.md",
|
||||
"size": 2796
|
||||
"size": 2796,
|
||||
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413"
|
||||
}
|
||||
],
|
||||
"version": "0.6.129"
|
||||
"schema": 1,
|
||||
"version": "0.6.130"
|
||||
}
|
||||
+4
-3
@@ -2,6 +2,7 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
IDI_KSWITCHER ICON "kswitcher.ico"
|
||||
IDI_KSWITCHER_PAUSED ICON "kswitcher-paused.ico"
|
||||
#ifdef KS_SCREENSHOT_RESOURCES
|
||||
IDI_SCREENSHOT_QUESTION ICON "icons/question.ico"
|
||||
IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
|
||||
@@ -9,8 +10,8 @@ IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
|
||||
1 RT_MANIFEST "app.manifest"
|
||||
201 RCDATA "update.ps1"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 0,6,129,0
|
||||
PRODUCTVERSION 0,6,129,0
|
||||
FILEVERSION 0,6,130,0
|
||||
PRODUCTVERSION 0,6,130,0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
BEGIN
|
||||
@@ -20,7 +21,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility"
|
||||
VALUE "ProductName", "KSwitcher"
|
||||
VALUE "FileVersion", "0.6.129"
|
||||
VALUE "FileVersion", "0.6.130"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -4,4 +4,5 @@
|
||||
#define IDI_FILES_VIEWER 103
|
||||
#define IDI_FILES_EDITOR 104
|
||||
#define IDI_FILES_COMPARE 105
|
||||
#define IDI_KSWITCHER_PAUSED 106
|
||||
#define IDC_SCREENSHOT_PENCIL 500
|
||||
+11
-9
@@ -986,6 +986,12 @@ HICON trayInputIcon(HICON base, int width, int height, uint32_t color)
|
||||
}
|
||||
}
|
||||
|
||||
HICON App::trayBaseIcon(int width, int height) const
|
||||
{
|
||||
const auto resource = inputState == InputState::Active ? IDI_KSWITCHER : IDI_KSWITCHER_PAUSED;
|
||||
return static_cast<HICON>(LoadImageW(instance, MAKEINTRESOURCEW(resource), IMAGE_ICON, width, height, LR_SHARED));
|
||||
}
|
||||
|
||||
bool App::updateTray(DWORD action, bool notifyFile)
|
||||
{
|
||||
NOTIFYICONDATAW icon{sizeof(icon)};
|
||||
@@ -995,17 +1001,13 @@ bool App::updateTray(DWORD action, bool notifyFile)
|
||||
if (action == NIM_ADD) icon.uFlags |= NIF_MESSAGE;
|
||||
icon.uCallbackMessage = TrayMessage;
|
||||
const int width = GetSystemMetrics(SM_CXSMICON), height = GetSystemMetrics(SM_CYSMICON);
|
||||
icon.hIcon = (HICON)LoadImageW(instance, MAKEINTRESOURCEW(IDI_KSWITCHER), IMAGE_ICON, width, height, LR_SHARED);
|
||||
icon.hIcon = trayBaseIcon(width, height);
|
||||
HICON badge{};
|
||||
auto tip = localBuildTitle(L"KSwitcher");
|
||||
if (inputState == InputState::Active) tip += L" — Input processing active";
|
||||
if (inputState != InputState::Active)
|
||||
{
|
||||
tip += inputState == InputState::Paused ? L" — Input processing paused" : L" — Pausing input processing…";
|
||||
badge = trayInputIcon(icon.hIcon, width, height, 0xff858585);
|
||||
if (badge) icon.hIcon = badge;
|
||||
}
|
||||
else if (trayInput.paired)
|
||||
const auto state = inputState.load();
|
||||
tip += state == InputState::Active ? L" — Input processing active" :
|
||||
state == InputState::Paused ? L" — Input processing paused" : L" — Pausing input processing…";
|
||||
if (state == InputState::Active && trayInput.paired)
|
||||
{
|
||||
const bool reconnecting = trayInput.reconnecting();
|
||||
const uint32_t color = trayInput.stopped ? 0xfff16b66 : !trayInput.online ? 0xffa0a4ab :
|
||||
|
||||
@@ -170,6 +170,7 @@ class App
|
||||
bool trayRetryPending{};
|
||||
LanInputConnections trayInput;
|
||||
bool trayInputPulse{};
|
||||
HICON trayBaseIcon(int width, int height) const;
|
||||
bool updateTray(DWORD action, bool notifyFile = false);
|
||||
void refreshTrayInput();
|
||||
uint64_t transformAttempt{}, previousAttemptVersion{};
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include "platform.h"
|
||||
namespace ks
|
||||
{
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.129";
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.130";
|
||||
inline constexpr UINT UpdateMessage = WM_APP + 7;
|
||||
inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000;
|
||||
inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000;
|
||||
|
||||
@@ -34,6 +34,7 @@ struct InputRegressionAccess {
|
||||
// Queue a real expansion just before TrackPopupMenu returns the pause command.
|
||||
if (msg == WM_EXITMENULOOP && app.inputState == App::InputState::Active)
|
||||
queuedSnippet = app.queueSnippet(w, 0, 2, w);
|
||||
if (msg == ProbeTrayIcon) return trayIconMatchesInput(app.trayBaseIcon(16, 16), wp != 0);
|
||||
if (msg != ProbeInputState) return DefSubclassProc(w, msg, wp, lp);
|
||||
// Also exercise settings/layout updates that would normally re-register shortcuts.
|
||||
if (wp && app.inputState == App::InputState::Paused) {
|
||||
|
||||
@@ -52,6 +52,29 @@ void chooseInputAction(HWND resident, DWORD pid, const wchar_t *expected)
|
||||
}
|
||||
}
|
||||
|
||||
bool trayIconMatchesInput(HICON icon, bool active)
|
||||
{
|
||||
HDC dc = CreateCompatibleDC(nullptr);
|
||||
HBITMAP bitmap = CreateBitmap(16, 16, 1, 32, nullptr);
|
||||
bool matches = false;
|
||||
if (dc && bitmap) {
|
||||
const auto previous = SelectObject(dc, bitmap);
|
||||
if (icon && DrawIconEx(dc, 0, 0, icon, 16, 16, 0, nullptr, DI_NORMAL)) {
|
||||
const auto tile = GetPixel(dc, 2, 8);
|
||||
const auto white = RGB(255, 255, 255);
|
||||
const auto gap = GetPixel(dc, 8, 8);
|
||||
// The active keycap is purple. The pause glyph has two white strokes with a gap.
|
||||
matches = active ? GetBValue(tile) > GetRValue(tile) + 70 :
|
||||
GetPixel(dc, 5, 8) == white && GetPixel(dc, 10, 8) == white &&
|
||||
GetRValue(gap) < 160 && std::abs(GetBValue(gap) - GetRValue(gap)) < 32;
|
||||
}
|
||||
SelectObject(dc, previous);
|
||||
}
|
||||
if (bitmap) DeleteObject(bitmap);
|
||||
if (dc) DeleteDC(dc);
|
||||
return matches;
|
||||
}
|
||||
|
||||
int testInputPause()
|
||||
{
|
||||
auto name = L"KSwitcher-input-pause-" + ks::newSnippetId();
|
||||
@@ -77,25 +100,30 @@ int testInputPause()
|
||||
resident = childWindow(child.dwProcessId, L"KSwitcher.Main");
|
||||
return resident && query(resident, ProbeInputState) == 1;
|
||||
}, "resident did not start with both hooks and shortcuts");
|
||||
require(query(resident, ProbeTrayIcon, TRUE), "active tray icon missing at startup");
|
||||
constexpr UINT mods = MOD_CONTROL | MOD_SHIFT;
|
||||
require(!RegisterHotKey(nullptr, 1, mods, VK_F23) && GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED,
|
||||
"Files shortcut should be owned by resident before pause");
|
||||
chooseInputAction(resident, child.dwProcessId, L"Pause &input processing");
|
||||
until([&] { return query(resident, ProbeInputState) == 2; },
|
||||
"pause did not release both hooks and bindings and cancel the queued snippet");
|
||||
require(query(resident, ProbeTrayIcon), "pause bars missing after pause");
|
||||
require(RegisterHotKey(nullptr, 1, mods, VK_F23), "another process could not acquire Files shortcut");
|
||||
require(query(resident, ProbeInputState, 1) == 2, "settings, layout reload or IPC restarted input");
|
||||
chooseInputAction(resident, child.dwProcessId, L"Resume &input processing");
|
||||
require(query(resident, ProbeInputState) == 2, "Files conflict partially resumed input");
|
||||
require(query(resident, ProbeTrayIcon), "Files shortcut conflict cleared the pause icon");
|
||||
require(UnregisterHotKey(nullptr, 1), "cannot release Files shortcut");
|
||||
require(RegisterHotKey(nullptr, 2, mods, VK_F22), "cannot occupy hook shortcut during pause");
|
||||
chooseInputAction(resident, child.dwProcessId, L"Resume &input processing");
|
||||
require(query(resident, ProbeInputState) == 2, "hook shortcut conflict partially resumed input");
|
||||
require(query(resident, ProbeTrayIcon), "hook shortcut conflict cleared the pause icon");
|
||||
require(RegisterHotKey(nullptr, 1, mods, VK_F23), "failed resume leaked Files registration");
|
||||
UnregisterHotKey(nullptr, 1);
|
||||
UnregisterHotKey(nullptr, 2);
|
||||
chooseInputAction(resident, child.dwProcessId, L"Resume &input processing");
|
||||
require(query(resident, ProbeInputState) == 1, "resume did not restore both hooks and shortcuts");
|
||||
require(query(resident, ProbeTrayIcon, TRUE), "active tray icon missing after resume");
|
||||
require(!RegisterHotKey(nullptr, 1, mods, VK_F23) && GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED,
|
||||
"resident did not reclaim Files shortcut");
|
||||
std::cout << "Tray pause/resume, hooks, settings reload, cross-process ownership and conflict rollback passed.\n";
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
#include <windows.h>
|
||||
|
||||
inline constexpr UINT ProbeInputState = WM_APP + 200;
|
||||
inline constexpr UINT ProbeTrayIcon = WM_APP + 201;
|
||||
bool trayIconMatchesInput(HICON icon, bool active);
|
||||
int testInputPause();
|
||||
@@ -45,6 +45,26 @@ frames[-1].save(root / 'kswitcher-files.ico', sizes=icon_sizes, append_images=fr
|
||||
if args.files_only:
|
||||
raise SystemExit
|
||||
|
||||
# Keep the two pause bars aligned to whole pixels at each tray size.
|
||||
def draw_paused_icon(size):
|
||||
scale = 8
|
||||
tile = Image.new('RGBA', (size * scale, size * scale))
|
||||
unit = size * scale / 32
|
||||
ImageDraw.Draw(tile).rounded_rectangle(
|
||||
(unit, unit, 31 * unit - 1, 31 * unit - 1), radius=7 * unit, fill='#575E68')
|
||||
tile = tile.resize((size, size), Image.Resampling.LANCZOS)
|
||||
draw = ImageDraw.Draw(tile)
|
||||
top = round(size / 4)
|
||||
left = round(size / 4)
|
||||
width = round(size * 3 / 16)
|
||||
for x in (left, size - left - width):
|
||||
draw.rectangle((x, top, x + width - 1, size - top - 1), fill='white')
|
||||
return tile
|
||||
|
||||
|
||||
paused_frames = [draw_paused_icon(size) for size, _ in icon_sizes]
|
||||
paused_frames[-1].save(root / 'kswitcher-paused.ico', sizes=icon_sizes, append_images=paused_frames[:-1])
|
||||
|
||||
# Geometric K: white stem/upper arm, mint lower arm on an indigo keycap.
|
||||
polygons = [('#FFFFFF', [(8, 7), (12, 7), (12, 25), (8, 25)]),
|
||||
('#FFFFFF', [(11, 15), (22, 6), (25, 9), (14, 18)]),
|
||||
|
||||
Reference in new issue
Block a user