diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-08 17:50:48 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-08 15:53:46 +0000 |
commit | 8f884f056e80fefa766481dbc04ae3936ae29c97 (patch) | |
tree | f9abaaeb6d90331dce6ef660a5145001acf773ce /proto-mouse/ftnoir_protocol_mouse.cpp | |
parent | 16a8c0dd29a7014e4a4d161d407ea18d497b4579 (diff) |
proto/mouse: fix fraction
Diffstat (limited to 'proto-mouse/ftnoir_protocol_mouse.cpp')
-rw-r--r-- | proto-mouse/ftnoir_protocol_mouse.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/proto-mouse/ftnoir_protocol_mouse.cpp b/proto-mouse/ftnoir_protocol_mouse.cpp index 2bf91a84..3afee411 100644 --- a/proto-mouse/ftnoir_protocol_mouse.cpp +++ b/proto-mouse/ftnoir_protocol_mouse.cpp @@ -17,9 +17,8 @@ # define MOUSEEVENTF_MOVE_NOCOALESCE 0x2000 #endif -static const double invert[] = -{ - 1., 1., 1., +static const double invert[] = { + 1., 1., 1., 1., -1., 1. }; @@ -52,10 +51,12 @@ void mouse::pose(const double* headpose) INPUT input; input.type = INPUT_MOUSE; input.mi = mi; - (void) SendInput(1, &input, sizeof(INPUT)); - - last_x = mouse_x; - last_y = mouse_y; + if (mi.dx || mi.dy) + { + (void) SendInput(1, &input, sizeof(INPUT)); + last_x = mouse_x; + last_y = mouse_y; + } } QString mouse::game_name() |