Compare commits

..
13 changed files with 93 additions and 54 deletions

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.24)
project(KSwitcher VERSION 0.6.54 LANGUAGES CXX RC)
project(KSwitcher VERSION 0.6.55 LANGUAGES CXX RC)
if(NOT WIN32)
message(FATAL_ERROR "KSwitcher uses native Windows APIs")
endif()
+6
View File
@@ -346,6 +346,12 @@ Recognition uses Chrome accessibility: the address bar and active document must
**Українською.** З v0.6.51 підтримано Telegram Web K у Chrome. Відкрий чат, потім **Settings → Languages → Languages for a chat...**, вибери **Telegram Web: ім’я**, мови та **Use languages → Save**. Набір діє для Alt+Shift, Win+Space, Win+Shift+Space і Next layout. Вебпрофілі окремі від Telegram Desktop; однакові назви в різних акаунтах/профілях браузера мають спільний вебпрофіль. Адреса й назва беруться через accessibility, без OCR, таймера, розширення та читання історії повідомлень. В адресному рядку, на головній сторінці й для непідтримуваних адрес профіль не діє. Web A та інші браузери не перевірені й не заявлені як підтримувані.
### Desktop chat snippet selection — v0.6.55
ChatGPT and Codex desktop editors use paced selection for snippet triggers. If only a verified suffix is selected, KSwitcher extends the selection and verifies the full trigger before replacement. Unrelated text or changed focus cancels the operation. Triggers remain recognized across keyboard layouts. One snippet can target multiple applications: add each with **Add app**, or enter comma-separated process names. These existing application scopes also synchronize.
**Українською.** У настільних ChatGPT і Codex тригер виділяється з паузами між натисканнями. Якщо виділилася лише перевірена кінцева частина, KSwitcher доповнює виділення й перевіряє весь тригер перед заміною. Інший текст або зміна фокусу скасовують операцію. Тригери розпізнаються в різних розкладках. Один сніпет можна прив’язати до кількох програм через **Add app** або назви процесів через кому; ці прив’язки вже підтримують синхронізацію.
### Application-specific snippets — v0.6.51
In **Tools → Snippets**, select a snippet and enable **Only in these applications**. Enter executable names separated by commas, or select a currently open application's process and choose **Add app**. For example: `ms-teams.exe, outlook.exe`. Uncheck the option for a global snippet. A checked but empty restriction cannot be saved. Save applies the changes; Cancel discards them.
Binary file not shown.
+5 -7
View File
@@ -1,16 +1,14 @@
# Latest Windows release
## v0.6.54 — 2026-11-06
## v0.6.55 — 2026-11-06
## Changes
- Add **Smoothing (0–100%)** to the screenshot editor toolbar. Adjust the selected pencil stroke, or set the default for new strokes when no pencil stroke is selected (initially 25%). **Apply to all strokes** updates all pencil strokes in the image and the default. Text, highlights and geometric shapes are unchanged.
- Retain original pencil samples: zero restores the original path, and reducing smoothing restores detail without accumulating distortion. Moving, endpoint editing, cloning, undo/redo and PNG export preserve the chosen geometry. Each slider drag or bulk change is one undo step. Very short strokes remain unchanged; Shift-constrained and linked strokes start unsmoothed but can be adjusted explicitly. Shape recognition remains separate.
- Show **No unsaved changes** in Settings with **Save** disabled until edits are pending. Show **Unsaved changes — click Save to apply** for pending edits, including accepted chat-language, OCR and automatic-correction preferences. Cancelling a child dialog or restoring the original values updates the state immediately. Separately saved snippets do not falsely mark Settings as unsaved.
- Avoid creating empty personal-dictionary entries when accepting unchanged automatic-correction options, preventing a false unsaved-state indication.
- Retain chat-language synchronization from v0.6.53 and **Arc (U)** from v0.6.52.
- Fix long snippets failing in ChatGPT and Codex desktop editors when only part of the trigger was selected. Selection now uses paced key events in these applications.
- Recover a partial snippet selection only when the copied text matches a suffix of the trigger in a recognized keyboard layout. Verify the complete trigger before replacing it; preserve surrounding text and restore the clipboard. Far Manager keeps its dedicated selection path.
- Existing cross-layout trigger recognition and binding one snippet to multiple applications remain supported. Clarify these behaviors in the bilingual snippet guide; no new syntax or settings are required.
## Validation
Passed 774 settings/chat-profile checks, 568 input checks, 332 native checks, 126 sync checks, dictionary equivalence (140,939 words), wheel, StayHere, Utilities, screenshot UI/save/registration, 54 updater checks and updater progress checks. Smoothing checks cover defaults, per-stroke and bulk edits, reversible geometry, movement/cloning/endpoints, undo grouping and exact PNG restoration at zero. Settings checks cover clean/dirty/reverted/invalid states and accepted/cancelled child changes. Inspected actual editor and Settings renderings, including Settings at 250% scaling. Published assets, checksums, executable versions, updater selection and bilingual Wiki pages are verified during publication.
Passed targeted native partial-selection recovery, including the ChatGPT process selection policy, 776 settings/chat-profile checks, 568 input checks, 332 native checks, 126 sync checks, dictionary equivalence (140,939 words), wheel, StayHere, Utilities, screenshot UI/save/registration, 54 updater checks and updater progress checks. The reporter confirmed successful expansion in the actual chat, including typing in another layout. The broader snippet suite encountered foreground loss in its buffered Enter scenario; that run is not counted as passing. Release package, version, checksum, updater and published Wiki verification are performed as part of publication.
## Upgrade and compatibility
Choose **Update** in the tray menu. Legacy v0.3.0–v0.4.1 clients first receive the v0.4.2 compatibility bridge, then the current full release. v0.2.3 and earlier require manual installation.
+1 -1
View File
@@ -1 +1 @@
e7a0d76f89d7d15123378390e1b549000404c4be2463160de95f9c1626687a59 KSwitcher-win-x64.zip
42ffb2ea131983134897bf8a4e74a56ec2716cdc411930e417739fa35c95e6b2 KSwitcher-win-x64.zip
+31 -31
View File
@@ -1,81 +1,81 @@
{
"version": "0.6.51",
"schema": 1,
"version": "0.6.55",
"files": [
{
"size": 1847296,
"sha256": "30f7942d26f049a6abac6a36778696cc285888d31ad42a5ed2b53097aeda72d5",
"path": "KSwitcher.exe",
"sha256": "c40f90944169ec6f1b92803ccaec734573bf798939f13ab3553b982b709e479c"
"size": 1850368
},
{
"size": 1716224,
"sha256": "1cf6d8f1b5b8a4299edaf8a28cbaede9264b667edbe095c1e5156eedf0ef2089",
"path": "KSwitcher.Config.exe",
"sha256": "8e8a5fee9be8f318b78516b82415c6b098ac67f7c374f4667ef271576a77f9fa"
"size": 1718784
},
{
"size": 2897408,
"sha256": "daa58f6800b21a6f50f5e0ceb32505ede0637e05aad57c383d8845ccec2420f1",
"path": "KSwitcher.Screenshot.exe",
"sha256": "bb5ffc3a26955c752d593ba06f69476985d9902f2ed0345fe3efe9bfc2eb63c8"
"size": 2903040
},
{
"size": 4401,
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c",
"path": "LICENSE",
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c"
"size": 4401
},
{
"size": 1096,
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831",
"path": "json-LICENSE.txt",
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831"
"size": 1096
},
{
"size": 74601,
"sha256": "3c9947f562fae119b058c7a1230874bf3430145d8ac8d7bfc5fa89ae708f6a89",
"path": "README.md",
"sha256": "818f81e6c4bfaa6b014ac50351ec22f68ee6eb3c094ad5ecb7bac98d605e0918"
"size": 78153
},
{
"size": 732485,
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9",
"path": "dictionaries/en.txt",
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9"
"size": 732485
},
{
"size": 20566,
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5",
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5"
"size": 20566
},
{
"size": 2265,
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311",
"path": "dictionaries/README.md",
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311"
"size": 2265
},
{
"size": 1109134,
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849",
"path": "dictionaries/ru.txt",
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849"
"size": 1109134
},
{
"size": 1280,
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408",
"path": "dictionaries/sources.json",
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408"
"size": 1280
},
{
"size": 940799,
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf",
"path": "dictionaries/uk.txt",
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf"
"size": 940799
},
{
"size": 993,
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a",
"path": "tools/README.txt",
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a"
"size": 993
},
{
"size": 134656,
"sha256": "6ef5cf64708d62b7fc63c3c793cc99188a513433ff4774cae01dc014f6664376",
"path": "tools/StayHere.exe",
"sha256": "6ef5cf64708d62b7fc63c3c793cc99188a513433ff4774cae01dc014f6664376"
"size": 134656
},
{
"size": 2796,
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413",
"path": "tools/StayHere-README.md",
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413"
"size": 2796
}
]
}
+3 -3
View File
@@ -9,8 +9,8 @@ IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
1 RT_MANIFEST "app.manifest"
201 RCDATA "update.ps1"
1 VERSIONINFO
FILEVERSION 0,6,54,0
PRODUCTVERSION 0,6,54,0
FILEVERSION 0,6,55,0
PRODUCTVERSION 0,6,55,0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
@@ -20,7 +20,7 @@ BEGIN
BEGIN
VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility"
VALUE "ProductName", "KSwitcher"
VALUE "FileVersion", "0.6.54"
VALUE "FileVersion", "0.6.55"
END
END
BLOCK "VarFileInfo"
+9 -3
View File
@@ -1490,11 +1490,17 @@ void App::transform(int command, int snippet)
}
Run tail = recent;
tail.keys = tail.keys.substr(tail.keys.size() - sn.trigger.size());
if (!tx.select(sn.trigger.size()))
return;
autoSelected = true;
reason = L"snippet-verification-mismatch";
text = tx.copy();
if (farSnippet)
{
if (!tx.select(sn.trigger.size())) return;
text = tx.copy();
}
else
text = tx.copyRange(sn.trigger.size(), tail.keys,
[&](const std::wstring &candidate) { return tail.match(candidate, available, physicalLayout()) >= 0; },
[&](const std::wstring &candidate) { return tail.matchSuffix(candidate, available, physicalLayout()) >= 0; });
if (tail.match(text, available, physicalLayout()) < 0)
return;
automatic = true;
+1 -1
View File
@@ -435,7 +435,7 @@ bool needsSelectionDelay(HWND target)
{
const auto name = lower(processName(target));
return name == L"ms-teams" || name == L"msedgewebview2" ||
name == L"chrome" || name == L"msedge";
name == L"chrome" || name == L"msedge" || name == L"chatgpt" || name == L"codex";
}
bool selectPrevious(size_t count, const std::function<bool()> &valid)
{
+1 -1
View File
@@ -2,7 +2,7 @@
#include "platform.h"
namespace ks
{
inline constexpr wchar_t AppVersion[] = L"0.6.54";
inline constexpr wchar_t AppVersion[] = L"0.6.55";
inline constexpr UINT UpdateMessage = WM_APP + 7;
inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000;
inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000;
+9 -1
View File
@@ -21,6 +21,7 @@ void contextChecks()
ks::validateSettings(scoped);
require(ks::snippetAppPriority(scoped.snippets[1], L"ms-teams") > ks::snippetAppPriority(scoped.snippets[0], L"ms-teams"), "app snippet precedes global regardless of list order");
require(ks::snippetAppPriority(scoped.snippets[1], L"Telegram.exe") == 0, "restricted snippet cannot run in another app");
require(ks::snippetAppPriority(scoped.snippets[1], L"Outlook.EXE") == 2, "restricted snippet also runs in its second application");
require(ks::snippetAppPriority(scoped.snippets[0], L"") == 1, "legacy/global snippets remain available");
auto scopedRoundtrip = ks::decodeSettings(ks::encodeSettings(scoped), {});
require(scopedRoundtrip.snippets[1].apps == std::vector<std::wstring>{L"ms-teams", L"outlook"}, "scopes normalize and persist");
@@ -257,7 +258,14 @@ int main()
require(IsDlgButtonChecked(snippets,314)==BST_UNCHECKED, "old snippet shows everywhere");
CheckDlgButton(snippets,314,BST_CHECKED);
SendMessageW(snippets,WM_COMMAND,314,0);
SetDlgItemTextW(snippets,315,L"Notepad.exe, MS-Teams.EXE");
SetDlgItemTextW(snippets,315,L"Notepad.exe");
auto secondApp = SendDlgItemMessageW(snippets,316,CB_ADDSTRING,0,(LPARAM)L"MS-Teams.EXE");
SendDlgItemMessageW(snippets,316,CB_SETCURSEL,secondApp,0);
SendMessageW(snippets,WM_COMMAND,317,0);
SendMessageW(snippets,WM_COMMAND,317,0);
wchar_t appList[128]{};
GetDlgItemTextW(snippets,315,appList,128);
require(std::wstring(appList)==L"Notepad.exe, MS-Teams.EXE", "Add app appends a second application without duplicates");
SendMessageW(snippets,WM_COMMAND,IDOK,0);
require(!app.snippetsWindow && app.settings.snippets[0].apps==std::vector<std::wstring>{L"notepad",L"ms-teams"}, "snippet editor saves selected applications");
require(!saveEnabled() && status()==L"No unsaved changes.","separately saved snippet edit leaves Settings clean");
+24 -3
View File
@@ -22,6 +22,7 @@ namespace
ks::App *app{};
HWND host{}, field{};
ks::Clip saved;
bool snippetRecoveryOnly = false;
bool captured = false, failed = false;
bool conversionOnly = false;
bool typosOnly = false;
@@ -588,10 +589,29 @@ LRESULT CALLBACK procedure(HWND w, UINT msg, WPARAM wp, LPARAM lp)
require(ks::readClipboard(app->window).text() == sentinel, "selected and repeated conversions restore clipboard");
finish();
break;
case 62:
case 64:
saved = ks::readClipboard(app->window, 64 * 1024 * 1024);
captured = true;
app->ownSequence = ks::writeClipboard(app->window, ks::textClip(sentinel));
app->settings.snippets = {{L";repo-changes-jira", L"expanded{cursor}"}};
ActivateKeyboardLayout(app->layouts[en].handle, 0);
prepare(L"prefix ;repo-changes-jira", false);
record(L";repo-changes-jira");
droppedSelectionKeys = 10;
enterPresses = 0;
app->transform(0, 0);
break;
case 65:
require(text() == L"prefix expanded", "long snippet recovers partial selection and preserves prefix");
require(droppedSelectionKeys == 0 && enterPresses == 0, "snippet recovery consumes missing arrows without Enter");
require(ks::readClipboard(app->window).text() == sentinel, "snippet recovery restores clipboard");
if (snippetRecoveryOnly) { finish(); break; }
stage = 62;
break;
case 62:
if (!captured) saved = ks::readClipboard(app->window, 64 * 1024 * 1024);
captured = true;
app->ownSequence = ks::writeClipboard(app->window, ks::textClip(sentinel));
app->settings.snippets = {{L";r", L"unexpected{enter}"}};
ActivateKeyboardLayout(app->layouts[en].handle, 0);
prepare(L"prefix ", false);
@@ -1038,8 +1058,9 @@ int main(int argc, char **argv)
SetWindowSubclass(field, observeEnter, 1, 0);
if (typosOnly || (argc > 1 && std::string(argv[1]) == "--typing-only"))
stage = 20;
if (argc > 1 && std::string(argv[1]) == "--snippets-only")
stage = 62;
snippetRecoveryOnly = argc > 1 && std::string(argv[1]) == "--snippet-recovery-only";
if (snippetRecoveryOnly || (argc > 1 && std::string(argv[1]) == "--snippets-only"))
stage = 64;
SetTimer(host, 1, 100, nullptr);
auto forwarding = SetWindowsHookExW(WH_KEYBOARD_LL,forwardingHook,GetModuleHandleW(nullptr),0);
require(forwarding!=nullptr,"downstream forwarding fixture installed before application hook");
+2 -2
View File
@@ -145,9 +145,9 @@ int main()
}
{
Settings scoped = local;
scoped.snippets.push_back({L"test", L"Only Teams", L"teams-scope", {L"ms-teams"}});
scoped.snippets.push_back({L"test", L"Work apps", L"teams-scope", {L"ms-teams", L"outlook"}});
auto wire=sharedSyncSettings(scoped);
require(restoreSyncSettings(wire, local, {}).snippets[1].apps==std::vector<std::wstring>{L"ms-teams"}, "sync preserves app scope");
require(restoreSyncSettings(wire, local, {}).snippets[1].apps==std::vector<std::wstring>{L"ms-teams", L"outlook"}, "sync preserves multiple app scopes");
auto leftScope=j,rightScope=j;
leftScope["snippets"].push_back({{"id","left-scope"},{"trigger","same"},{"text","left"},{"apps",Json::array({"notepad"})}});
rightScope["snippets"].push_back({{"id","right-scope"},{"trigger","same"},{"text","right"},{"apps",Json::array({"ms-teams"})}});