Run the following code (warning it causes an infinite loop):
use std::thread::sleep;
use std::time::Duration;
use autopilot::key::Character;
loop {
autopilot::key::toggle(&Character('s'), true, &[], 0);
sleep(Duration::from_millis(100));
autopilot::key::toggle(&Character('s'), false, &[], 0);
sleep(Duration::from_millis(100));
}
This code will infinitely press the s key. While it is pressing the s key, repeatedly tap the y key on your keyboard.
You will see a pattern like this:
sssssssy;y;y;syy;y;y;y;y;yssy;y;y;sysy;y;y;y;y;yy;y;y;y;y;y;sssssssssssssysy;y;y;yy;y;y;y;yy;y;;sss
Even though the code is not pressing the ; key, and you did not press the ; key, it still causes spurious ; presses.
I don't know if this is a bug with autopilot, XTest, or perhaps my specific hardware. It's a very strange bug.
Run the following code (warning it causes an infinite loop):
This code will infinitely press the
skey. While it is pressing theskey, repeatedly tap theykey on your keyboard.You will see a pattern like this:
Even though the code is not pressing the
;key, and you did not press the;key, it still causes spurious;presses.I don't know if this is a bug with autopilot, XTest, or perhaps my specific hardware. It's a very strange bug.