Release v0.6.43: fix forwarded input and verify snippet pastes

This commit is contained in:
2026-11-04 21:18:39 +02:00
parent a2b88f247c
commit 6621a49022
14 changed files with 239 additions and 33 deletions
+19
View File
@@ -94,6 +94,9 @@ struct InputRegressionAccess {
}
static void notificationSetup(App &a) { a.updateNotifier = notify; }
static void setup(App &a) { a.hookBindings = {{Toggle,{MOD_CONTROL,VK_F12}}, {Case,{MOD_CONTROL|MOD_SHIFT,'U'}}}; }
static LRESULT routedKey(int code, UINT message, const KBDLLHOOKSTRUCT &key, LRESULT routed) {
return App::keyboardAfterHooks(code,message,(LPARAM)&key,routed);
}
static bool updateTimer(App &a) {
a.updateRunning=true; // Exercise timer scheduling without launching a network request.
App::windowProc(a.window,WM_TIMER,5,0);
@@ -648,6 +651,22 @@ int main(int argc, char **argv) {
};
auto commands=[&] { MSG m{}; int n=0; while(PeekMessageW(&m,app.window,WM_HOTKEY,WM_HOTKEY,PM_REMOVE)) ++n; return n; };
auto f12=event(VK_F12);
{
const auto before = app.inputVersion.load();
const auto recorded = app.run.keys;
for (UINT message : {WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP})
require(ks::InputRegressionAccess::routedKey(HC_ACTION,message,event('A',30),7)==7,
"forwarded keyboard events preserve downstream suppression");
require(app.inputVersion==before && app.run.keys==recorded && commands()==0,
"forwarded events never track text, invalidate transactions or dispatch shortcuts");
require(ks::InputRegressionAccess::routedKey(-1,WM_KEYDOWN,event('A',30),0)==0 &&
app.inputVersion==before,"negative hook codes do not process keyboard input");
require(ks::InputRegressionAccess::routedKey(HC_ACTION,WM_KEYDOWN,event('A',30,true),0)==0 &&
app.inputVersion==before,"own input remains excluded after downstream routing");
require(ks::InputRegressionAccess::routedKey(HC_ACTION,WM_KEYDOWN,event('A',30),0)==0 &&
app.inputVersion>before,"delivered remote input is still processed on the receiver");
app.run.reset();
}
require(!app.handleKeyboard(event(VK_LCONTROL),true,0),"remote modifier passes through");
require(app.handleKeyboard(f12,true,MOD_CONTROL),"remote Ctrl+F12 handled");
require(app.handleKeyboard(f12,true,MOD_CONTROL),"remote repeat suppressed");