I've been working on a script that uses keyboard hooks so there can be reactions to the key down and key up, and I notice that any time the computer is under a little bit of load (like opening a busy website or working under battery saver because the battery is almost dead) some inputs are not captured at all. I can consistently reproduce it, though sometimes via artificial load on the computer.
Here's a script that maps 2 keys for down and up. If I hit & release those 2 keys at the same time a number of times in a row, (again with a somewhat busy computer) actions will not get captured on some attempts. I used Send functions with arbitrary numbers to make sure it wasn't a problem with sending the same key being pressed.
Code: Select all
#SingleInstance Force
KeyHistory(200)
hotkey "$*j", Send1, "On"
hotkey "$*j Up", Send2, "On"
hotkey "$*k", Send3, "On"
hotkey "$*k Up", Send4, "On"
Send1(key) {
Send("1")
; Send("11111")
; Send(key)
}
Send2(key) {
Send("2")
; Send("22222")
; Send(key)
}
Send3(key) {
Send("3")
; Send("33333")
; Send(key)
}
Send4(key) {
Send("4")
; Send("44444")
; Send(key)
}
Output on system:
Code: Select all
3124
314
134
Code: Select all
0D 01C d 0.36 Enter
0D 01C u 0.11 Enter
4B 025 h d 0.05 k
33 004 i d 0.01 3
33 004 i u 0.00 3
4A 024 h d 0.00 j
31 002 i d 0.00 1
31 002 i u 0.00 1
4A 024 h u 0.08 j
32 003 i d 0.00 2
32 003 i u 0.00 2
4B 025 h u 0.01 k
34 005 i d 0.00 4
34 005 i u 0.00 4
0D 01C d 0.38 Enter
0D 01C u 0.11 Enter
4B 025 h d 0.03 k
33 004 i d 0.00 3
33 004 i u 0.00 3
4A 024 h d 0.01 j
31 002 i d 0.00 1
31 002 i u 0.00 1
4B 025 h u 0.09 k
34 005 i d 0.00 4
34 005 i u 0.00 4
0D 01C d 0.30 Enter
0D 01C u 0.12 Enter
4A 024 h d 0.05 j
4B 025 h d 0.00 k
31 002 i d 0.00 1
31 002 i u 0.00 1
33 004 i d 0.02 3
33 004 i u 0.00 3
4B 025 h u 0.05 k
34 005 i d 0.00 4
34 005 i u 0.00 4
Code: Select all
047: Send("3")
050: }
037: Send("1") (0.02)
040: } (0.06)
042: Send("2") (0.01)
045: }
052: Send("4")
055: } (0.52)
047: Send("3") (0.01)
050: }
037: Send("1")
040: } (0.09)
052: Send("4")
055: } (0.47)
037: Send("1") (0.02)
040: }
047: Send("3")
050: } (0.05)
052: Send("4") (0.02)
055: } (35.62)
I've consistently reproduced by playing 8k video at 2x speed in the background, or loading a website from a crappy news organization that has more video ads than news, but choose your poison. Also been able to do it with a single key down-up under load, but it is more rare.