Bughater
Bughater

Reputation: 73

How to read the Windows 11 24H2 keyboard buffer in vba?

It seems possible to directly read the keyboard buffer i.e. in C++, but what about using vba ? I got struck because the compiler refuses the corresponding functions such as GetStdHandle() already upon their declaration. My goal is just to confirm the following bug in Windows 11 24H2:

When I create a new empty record in a MS Access form and type for example "a" in the current textbox, I get "➣a". On my modified keyboard, "➣" is a dead key character triggered by ALTGR>, but there is no character coded as . If I type "(" instead of, I will get "↻", which is coded as <(>. Typing further characters then works normally.

If I add a SendKeys line to the code creating the form's new record or press the key before or <(>, the output is correctly "a" and "(", respectively:

DoCmd.GoToRecord , , A_NEWREC
SendKeys "{BACKSPACE}"

Hence, it is evident that the keyboard buffer contains garbage when creating the new record (using only the mouse and vba code, without pressing any key on the keyboard) ! Likely, the garbage comprises or consists of (&H11&H12&H56 ?). This is what I would like to confirm.

NB: In Windows 7/8/8.1/10/11, this problem never occurred until October 2024. Note that I still use Office 2019 Pro version 2411 (18227.20162) because in the newer version 2412 MouseWheel() returns always Count=0

Upvotes: 0

Views: 64

Answers (0)

Related Questions