use CurrentTime (0) as default delay v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 30 Mar 2021 20:26:08 +0200
branchv_0
changeset 4 e5baa07d6e60
parent 3 2c4e533e9e33
child 5 dbf093b8b9ac
use CurrentTime (0) as default delay
src/X11Handler.h
--- a/src/X11Handler.h	Sun Mar 28 21:02:02 2021 +0200
+++ b/src/X11Handler.h	Tue Mar 30 20:26:08 2021 +0200
@@ -72,7 +72,7 @@
 		int key = -1;
 		int button = -1;
 		unsigned long screen = 0;
-		unsigned long delay = 1;
+		unsigned long delay = CurrentTime;
 		int x = -1;
 		int y = -1;
 	} currentEvent;
@@ -133,7 +133,7 @@
 
 		if (attributeIndex % attributes.size() == 0) {
 			if (currentEvent.type == Event::Type::KEY) {
-				XTestFakeKeyEvent(display.display, currentEvent.key, currentEvent.state == Event::State::PRESSED, 1);
+				XTestFakeKeyEvent(display.display, currentEvent.key, currentEvent.state == Event::State::PRESSED, currentEvent.delay);
 			} else if (currentEvent.type == Event::Type::BUTTON) {
 				XTestFakeButtonEvent(display.display, currentEvent.button, currentEvent.state == Event::State::PRESSED, currentEvent.delay);
 			} else if (currentEvent.type == Event::Type::MOTION) {