[refactor] organize GUI code by responsibility

This commit is contained in:
dijunkun
2026-07-19 21:23:20 +08:00
parent 1f86c43458
commit eeb6a2a1ae
73 changed files with 7918 additions and 7229 deletions
+7 -9
View File
@@ -25,18 +25,17 @@ int main() {
ok &= ExpectEqual("initial flags", state.flags(), 0);
ok &= ExpectEqual("left shift down", state.Update(0xA0, true),
crossdesk::kMacInjectedModifierShift);
ok &= ExpectEqual("shifted semicolon keeps shift",
state.Update(0xBA, true),
ok &= ExpectEqual("shifted semicolon keeps shift", state.Update(0xBA, true),
crossdesk::kMacInjectedModifierShift);
ok &= ExpectEqual("semicolon up keeps shift", state.Update(0xBA, false),
crossdesk::kMacInjectedModifierShift);
ok &= ExpectEqual("right shift down while left held",
state.Update(0xA1, true),
crossdesk::kMacInjectedModifierShift);
ok &=
ExpectEqual("right shift down while left held", state.Update(0xA1, true),
crossdesk::kMacInjectedModifierShift);
ok &= ExpectEqual("left shift up while right held", state.Update(0xA0, false),
crossdesk::kMacInjectedModifierShift);
ok &= ExpectEqual("right shift up clears shift", state.Update(0xA1, false),
0);
ok &=
ExpectEqual("right shift up clears shift", state.Update(0xA1, false), 0);
ok &= ExpectEqual("left control down", state.Update(0xA2, true),
crossdesk::kMacInjectedModifierControl);
@@ -53,8 +52,7 @@ int main() {
crossdesk::kMacInjectedModifierCommand);
ok &= ExpectEqual("right alt up leaves command", state.Update(0xA5, false),
crossdesk::kMacInjectedModifierCommand);
ok &= ExpectEqual("left command up clears all", state.Update(0x5B, false),
0);
ok &= ExpectEqual("left command up clears all", state.Update(0x5B, false), 0);
return ok ? 0 : 1;
}