Optimize swipe function
This commit is contained in:
parent
89b79bc9bc
commit
28f5ca2a91
@ -50,7 +50,8 @@ namespace comfortable_swipe::gesture
|
|||||||
):
|
):
|
||||||
comfortable_swipe::gesture::xdo_gesture(),
|
comfortable_swipe::gesture::xdo_gesture(),
|
||||||
threshold_squared(threshold*threshold),
|
threshold_squared(threshold*threshold),
|
||||||
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4})
|
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4}),
|
||||||
|
flag_swiping(false)
|
||||||
{
|
{
|
||||||
// improve responsiveness of first gesture by pre-empting xdotool runtime
|
// improve responsiveness of first gesture by pre-empting xdotool runtime
|
||||||
xdo_get_mouse_location(this->xdo, &this->ix, &this->iy, &this->screen_num);
|
xdo_get_mouse_location(this->xdo, &this->ix, &this->iy, &this->screen_num);
|
||||||
|
|||||||
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdio> // fgets_unlocked, stdin
|
#include <cstdio> // fgets_unlocked, stdin
|
||||||
|
#include <iostream> // std::ios, std::cout, std::cin
|
||||||
#include "../index.hpp"
|
#include "../index.hpp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,6 +30,11 @@ namespace comfortable_swipe::service
|
|||||||
{
|
{
|
||||||
void buffer()
|
void buffer()
|
||||||
{
|
{
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
std::cin.tie(0);
|
||||||
|
std::cout.tie(0);
|
||||||
|
std::cout.flush();
|
||||||
|
|
||||||
// read config file
|
// read config file
|
||||||
auto config = comfortable_swipe::util::read_config_file(comfortable_swipe::util::conf_filename());
|
auto config = comfortable_swipe::util::read_config_file(comfortable_swipe::util::conf_filename());
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user