feat(diagnostic): 完成阶段 0B 原生键盘隔离消费探测

This commit is contained in:
Codex
2026-10-07 04:06:59 +08:00
parent e514a7dbb9
commit 0db94a7d41
7 changed files with 1701 additions and 73 deletions
+35 -9
View File
@@ -35,7 +35,10 @@ int main(int argc, char** argv)
// fixture 每次只运行一个确定性场景,并用唯一标题让驱动脚本精确绑定 HWND。
const std::string scenario = argc > 1 ? argv[1] : "geometry";
const std::filesystem::path resultDir = argc > 2 ? argv[2] : "TestResults";
Window window(480, 320, 1, Background, "StellarX.UI." + scenario);
const bool consumeProbeScenario = scenario == "input-consume-probe";
const int windowWidth = consumeProbeScenario ? 720 : 480;
const int windowHeight = consumeProbeScenario ? 420 : 320;
Window window(windowWidth, windowHeight, 1, Background, "StellarX.UI." + scenario);
if (scenario == "ownership")
{
@@ -89,16 +92,25 @@ int main(int argc, char** argv)
button->setTooltipText("stationary tip");
window.addControl(std::move(button));
}
else if (scenario == "input-probe")
else if (scenario == "input-probe" || scenario == "input-consume-probe")
{
// 该场景只提供一个可聚焦的 EasyX 顶层窗口,不让控件消费或改写键盘/IME 消息。
const std::array<std::string, 5> instructions{
"StellarX input probe - manual IME run",
"1. Click this window, then switch to the requested IME.",
"2. Type only the agreed non-sensitive test strings.",
"3. Cover commit, candidate select, cancel and language switch.",
"4. Close the window after the checklist is complete."
};
const bool consumeProbe = scenario == "input-consume-probe";
const std::array<std::string, 5> instructions = consumeProbe
? std::array<std::string, 5>{
"StellarX stage 0B isolated consume probe",
"This window is driven by the bounded diagnostic runner.",
"Only one message, key and action rule is active.",
"No control receives business keyboard routing.",
"The runner will close this window after capture."
}
: std::array<std::string, 5>{
"StellarX input probe - manual IME run",
"1. Click this window, then switch to the requested IME.",
"2. Type only the agreed non-sensitive test strings.",
"3. Cover commit, candidate select, cancel and language switch.",
"4. Close the window after the checklist is complete."
};
int y = 30;
for (const std::string& line : instructions)
{
@@ -107,6 +119,20 @@ int main(int argc, char** argv)
window.addControl(std::move(label));
y += 42;
}
if (consumeProbe)
{
// 与 runner 传给 IMM32 的固定客户区坐标完全一致:行区 (200,255)-(680,284),
// caret bottom 为 (225,282)。仅用于人工确认候选框没有落回桌面边缘。
auto anchorLabel = std::make_unique<Label>(20, 260, "IME anchor:", WHITE, Background);
anchorLabel->setTextdisap(true);
window.addControl(std::move(anchorLabel));
auto lineRegion = std::make_unique<Canvas>(200, 255, 480, 29);
lineRegion->setCanvasBkColor(RGB(45, 70, 95));
window.addControl(std::move(lineRegion));
auto caret = std::make_unique<Canvas>(224, 258, 2, 24);
caret->setCanvasBkColor(HoverColor);
window.addControl(std::move(caret));
}
}
else if (scenario == "native-close")
{