Add mouse hold gestures (#79)

* Modularly separate keyboard swipe gesture from generic swipe

* Set destructors virtual to avoid surprises

* Prepare mouse swipe gesture skeleton

* Modify mouse move update

* Use xdo_move_mouse_relative instead of screen capture

* Restructure and add compiler tests

* Fix bash install script

* Add experimental: mouse hold on defaults.conf

* Update README and defaults.conf

* Do mousedown only for buttons 1 to 3

* Fix stop script and mouse gesture on button 4/5

* Redirect restart command to null

* Redirect using freopen

* Add comments on experimental scrolling
This commit is contained in:
Rico Tiongson authored and GitHub committed 2020-04-18 03:55:13 +08:00
1 parent 8f6e231a5e
commit a7c5b6d578
36 files changed
+922 -216

No files matched your search

+23 -5
View File
@@ -1,6 +1,24 @@
#!/bin/sh
#!/bin/bash
DIR=$(dirname $0)
g++ -std=c++11 -O2 $DIR/test_regex.cpp -lxdo -o test.out || exec "Test aborted"
./test.out || rm test.out
rm test.out
set -e
DIR="$(dirname "$0")"
# just call abort on error
tempout="$(mktemp)"
abort () {
rm "$tempout"
echo "Test aborted"
exit 1
}
# run all shell files in this directory
for sh in "$DIR/test_"*.sh; do
/bin/bash "$sh" || abort
done
# run all cpp files in this directory
for cpp in "$DIR/test_"*.cpp; do
g++ -std=c++11 -O2 "$cpp" -lxdo -o "$tempout" || abort
"$tempout" || abort
done
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -ex
DIR="$(dirname "$0")"
root="$(dirname "$DIR")"
compiler="$root/cpp.compile.sh"
command_line="$root/command_line.cpp"
module="$root/comfortable_swipe"
# just call abort on error
tempout="$(mktemp)"
abort () {
rm "$tempout"
echo "Test aborted"
exit 1
}
# try to compile every cpp/hpp file in module
# header files first
# then compile cpp files
# finally, compile command line
shopt -s nullglob
for cpp in \
"$module"/**/*.h \
"$module"/**/*.hpp \
"$module"/**/*.cpp \
"$module"/lib \
"$command_line"
do
"$compiler" -c "$cpp" -o "$tempout" || abort
done
Regular → Executable
+2 -2
View File
@@ -2,8 +2,8 @@
#include <cassert>
#include <regex>
#include <string>
#include "../lib/gesture/swipe_gesture.h"
#include "../lib/gesture/swipe_gesture.regex.cpp"
#include "../comfortable_swipe/gesture/swipe_gesture.h"
#include "../comfortable_swipe/gesture/swipe_gesture.regex.cpp"
/*
Comfortable Swipe