Status command (#56)

* Add configurations to status

* Update comment of status

* Add config command

* Modify README

* Add EPSILON instead of subtract for a more reliable >= threshold
This commit is contained in:
Rico Tiongson 2019-02-15 14:17:47 +08:00 committed by GitHub
parent 7d76db6693
commit 89b79bc9bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -87,7 +87,8 @@ namespace comfortable_swipe::gesture
? 1.00f
: 0.01f; // square root of 1/10
static const float EPSILON = 1e-6f;
if (this->x * this->x + this->y * this->y > this->threshold_squared * scale - EPSILON)
if (this->x * this->x + this->y * this->y
> this->threshold_squared * scale + EPSILON)
{
int mask = 0;
if (this->fingers == 3) mask |= swipe_gesture::MSK_THREE_FINGERS;

View File

@ -24,6 +24,8 @@ extern "C"
#include <xdo.h> // xdo, xdo_new
}
#include "xdo_gesture.h"
namespace comfortable_swipe::gesture
{
/**