Release KSwitcher v0.6.65
This commit is contained in:
1 parent
14f33012a3
commit
8a65e7f7fb
21 files changed
+570
-111
No files matched your search
@@ -125,6 +125,27 @@ struct InputRegressionAccess {
|
||||
return a.notifiedUpdate;
|
||||
}
|
||||
static void click() { MSLLHOOKSTRUCT m{}; m.flags=LLMHF_INJECTED; App::mouseProc(HC_ACTION,WM_LBUTTONDOWN,(LPARAM)&m); }
|
||||
static bool wheelQueuesAction(App &app)
|
||||
{
|
||||
MSLLHOOKSTRUCT mouse{};
|
||||
if (!GetCursorPos(&mouse.pt) || !WindowFromPoint(mouse.pt)) return false;
|
||||
auto previous = app.settings;
|
||||
app.settings.customMouseEvents[L"Wheel down"] = L"Wheel test";
|
||||
app.settings.mouseBindings[GlobalMouseProfile][L"Wheel down"] = {MouseActionType::Mute};
|
||||
mouse.mouseData = MAKEWPARAM(0, static_cast<WORD>(-30));
|
||||
const auto wheel = [&] { return App::mouseProc(HC_ACTION, WM_MOUSEWHEEL, reinterpret_cast<LPARAM>(&mouse)); };
|
||||
mouse.flags = LLMHF_INJECTED;
|
||||
wheel();
|
||||
const bool ignoredInjection = app.mouseActions.empty();
|
||||
mouse.flags = 0;
|
||||
const bool partial = wheel() == 1 && app.mouseActions.empty();
|
||||
mouse.mouseData = MAKEWPARAM(0, static_cast<WORD>(-90));
|
||||
const bool queued = wheel() == 1 && app.mouseActions.size() == 1 &&
|
||||
app.mouseActions.front().action.type == MouseActionType::Mute;
|
||||
app.mouseActions.clear();
|
||||
app.settings = std::move(previous);
|
||||
return ignoredInjection && partial && queued;
|
||||
}
|
||||
static bool volumeHoldStopsOnRelease(App &app)
|
||||
{
|
||||
constexpr int button = 3;
|
||||
@@ -203,6 +224,8 @@ int main(int argc, char **argv) {
|
||||
require(app.window!=nullptr,"message-only test window");
|
||||
require(ks::InputRegressionAccess::volumeHoldStopsOnRelease(app),
|
||||
"volume hold repeats after its delay and stops on release without an extra step");
|
||||
require(ks::InputRegressionAccess::wheelQueuesAction(app),
|
||||
"a registered physical wheel signal queues one action per detent");
|
||||
require(ks::mouseVolumeRepeatInterval(350) > ks::mouseVolumeRepeatInterval(1000) &&
|
||||
ks::mouseVolumeRepeatInterval(1000) > ks::mouseVolumeRepeatInterval(2000) &&
|
||||
!ks::isMouseVolumeStep(ks::MouseActionType::Mute),
|
||||
@@ -828,6 +851,14 @@ int main(int argc, char **argv) {
|
||||
require(!IsWindowEnabled(GetDlgItem(settings, IDOK)), "button detection is not a settings edit");
|
||||
require(ListView_GetItemCount(events) == 8 && Header_GetItemCount(ListView_GetHeader(events)) == 2,
|
||||
"mouse events have eight rows and two columns");
|
||||
SendMessageW(settings, WM_COMMAND, 762, 0);
|
||||
const auto addEvent = FindWindowW(L"KSwitcher.AddMouseEvent", nullptr);
|
||||
require(addEvent && GetDlgItem(addEvent, 764) && GetDlgItem(addEvent, 763) &&
|
||||
!IsWindowEnabled(GetDlgItem(addEvent, IDOK)), "Add mouse event waits for a physical signal");
|
||||
SendMessageW(addEvent, WM_COMMAND, IDOK, 0);
|
||||
require(IsWindow(addEvent) && ListView_GetItemCount(events) == 8,
|
||||
"the event editor cannot save an uncaptured signal");
|
||||
SendMessageW(addEvent, WM_COMMAND, IDCANCEL, 0);
|
||||
NMITEMACTIVATE click{};
|
||||
click.hdr = {events, 733, NM_DBLCLK};
|
||||
click.iItem = 7;
|
||||
|
||||
Reference in new issue
Block a user