From 5672ad9b28e53ad5c3cda47fc41ff9ab1430e092 Mon Sep 17 00:00:00 2001 From: Andrew Sun <0xandrewsun@gmail.com> Date: Thu, 4 Jan 2018 16:43:31 +0800 Subject: [PATCH 1/2] Fix ASSERT_OK macro --- AbsoluteTouch/CommandLineArgs.cpp | 44 +++++++++++++++---------------- AbsoluteTouch/TouchpadManager.cpp | 5 +++- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/AbsoluteTouch/CommandLineArgs.cpp b/AbsoluteTouch/CommandLineArgs.cpp index 0767f36..d956009 100644 --- a/AbsoluteTouch/CommandLineArgs.cpp +++ b/AbsoluteTouch/CommandLineArgs.cpp @@ -47,25 +47,25 @@ static bool ParsePercent(const std::string &str, int *out) return true; } - CommandLineArgs::CommandLineArgs(int argc, char *argv[]) - { - for (int i = 1; i < argc; ++i) { - if (std::strcmp(argv[i], "-t") == 0 && i < argc - 1) { - if (!ParseRect(argv[++i], &touchpadRect)) - return; - } else if (std::strcmp(argv[i], "-s") == 0 && i < argc - 1) { - if (!ParseRect(argv[++i], &screenRect)) - return; - } else if (std::strcmp(argv[i], "-w") == 0 && i < argc - 1) { - if (!ParsePercent(argv[++i], &smoothingWeight)) - return; - } else if (std::strcmp(argv[i], "-m") == 0) { - manageTouchpad = true; - } else if (std::strcmp(argv[i], "-c") == 0) { - sendClick = true; - } else { - return; - } - } - ok = true; - } +CommandLineArgs::CommandLineArgs(int argc, char *argv[]) +{ + for (int i = 1; i < argc; ++i) { + if (std::strcmp(argv[i], "-t") == 0 && i < argc - 1) { + if (!ParseRect(argv[++i], &touchpadRect)) + return; + } else if (std::strcmp(argv[i], "-s") == 0 && i < argc - 1) { + if (!ParseRect(argv[++i], &screenRect)) + return; + } else if (std::strcmp(argv[i], "-w") == 0 && i < argc - 1) { + if (!ParsePercent(argv[++i], &smoothingWeight)) + return; + } else if (std::strcmp(argv[i], "-m") == 0) { + manageTouchpad = true; + } else if (std::strcmp(argv[i], "-c") == 0) { + sendClick = true; + } else { + return; + } + } + ok = true; +} diff --git a/AbsoluteTouch/TouchpadManager.cpp b/AbsoluteTouch/TouchpadManager.cpp index 990c013..d2d1bf2 100644 --- a/AbsoluteTouch/TouchpadManager.cpp +++ b/AbsoluteTouch/TouchpadManager.cpp @@ -1,7 +1,10 @@ #include "TouchpadManager.h" #include -#define ASSERT_OK(x) if ((x) != SYN_OK) assert(false); +#define ASSERT_OK(x) do { \ + if ((x) != SYN_OK) \ + assert(false); \ +} while (0) TouchpadManager::TouchpadManager() { From a6f122424dac6c449cf070cab098eb9efa627a50 Mon Sep 17 00:00:00 2001 From: Andrew Sun <0xandrewsun@gmail.com> Date: Mon, 10 Dec 2018 22:00:35 -0800 Subject: [PATCH 2/2] Update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4be816d..5162e21 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ Synaptics "absolute mode" emulation in software. Ever wanted to use your laptop touchpad to play osu!, or to draw your signature? Well, now you can! +This project is now deprecated in favor of the new +[AbsoluteTouchEx](https://github.com/apsun/AbsoluteTouchEx) project, +which is compatible with more touchpads and faster. + ## Requirements - A Synaptics touchpad