Closed bclothier closed 1 year ago
Yes, I have had issues with this not working very reliably as well. If the SetKeyboardState
call is working well for you, including on various OSes, I am all for updating the code base to use this approach. 👍
This was supposed to be closed by PR #388 but didn't close automatically for some reason, so closing it.
This was supposed to be closed by PR #388 but didn't close automatically for some reason, so closing it.
If I recall correctly, I think the auto-close only happens when it is merged into the master
(primary) branch. So it would happen eventually, but probably not for a while... 😄
I'm testing the addin and I am finding that the
ShiftOpenDatabase
is not reliable.There is the following comment:
https://github.com/joyfullservice/msaccess-vcs-integration/blob/88efd2ce5a6b6f60f5988f1d8c29124ff33a1a9c/Version%20Control.accda.src/modules/modLibReference.bas#L13-L18
However, if I look at Win32 API documentations for
keybd_event
, there is a note:The
SendInput
is as far as I can tell similar semantically to VBA'sSendKeys
.In contrast, the documentation for
SetKeyboardState
has no such notes. More importantly, we have this following remarks:I believe the issue with both
keybd_event
andSendInput
is the same as the VBA'sSendKeys
-- they are at mercy at whatever window has the keyboard focus and that will be very painful to correctly handle. I use a variant of this code which appears to be reliable on several OSes, including Windows 11.Is there any reason why we shouldn't be using the
SetKeyboardState
?