March 06
On Saturday, 6 March 2021 at 11:48:55 UTC, Imperatorn wrote:
> On Saturday, 6 March 2021 at 11:34:33 UTC, Imperatorn wrote:
>> On Saturday, 6 March 2021 at 10:51:35 UTC, Preetpal wrote:
>>> On Saturday, 6 March 2021 at 09:07:05 UTC, Imperatorn wrote:
>>>> [...]
>>>
>>> There is an issue with the code where the running program very infrequently misses when the SHIFT key is released. As this program keeps track of what modifier keys are currently pressed (as it is supposed keep track of all key presses and key releases), this can cause the wrong keyboard shortcut to be triggered.
>>>
>>> [...]
>>
>> I see, back in the day when I did stuff like this, I used GetAsyncKeyState instead. Have you tried that approach?
>
> Or maybe it was GetKeyboardState, don't remember, was about 17 years ago 😁

According to the documentation (https://docs.microsoft.com/en-us/windows/win32/winmsg/lowlevelkeyboardproc) for the LowLevelKeyboardProc (the hook that my program installs), the hook is "called before the asynchronous state of the key is updated" so I cannot use GetAsyncKeyState.

I could probably use GetKeyboardState to make the program simpler but since I fixed it, I am probably not going to change it for a while :).
March 11
On Saturday, 6 March 2021 at 15:59:56 UTC, Preetpal wrote:
> On Saturday, 6 March 2021 at 11:48:55 UTC, Imperatorn wrote:
>> On Saturday, 6 March 2021 at 11:34:33 UTC, Imperatorn wrote:
>>> [...]
>>
>> Or maybe it was GetKeyboardState, don't remember, was about 17 years ago 😁
>
> According to the documentation (https://docs.microsoft.com/en-us/windows/win32/winmsg/lowlevelkeyboardproc) for the LowLevelKeyboardProc (the hook that my program installs), the hook is "called before the asynchronous state of the key is updated" so I cannot use GetAsyncKeyState.
>
> I could probably use GetKeyboardState to make the program simpler but since I fixed it, I am probably not going to change it for a while :).

I love how comprehensive this is. Including the resources is just brilliant. Thanks for sharing!
March 12
On Thursday, 11 March 2021 at 14:54:40 UTC, Lorenso wrote:
> On Saturday, 6 March 2021 at 15:59:56 UTC, Preetpal wrote:
>> On Saturday, 6 March 2021 at 11:48:55 UTC, Imperatorn wrote:
>>> [...]
>>
>> According to the documentation (https://docs.microsoft.com/en-us/windows/win32/winmsg/lowlevelkeyboardproc) for the LowLevelKeyboardProc (the hook that my program installs), the hook is "called before the asynchronous state of the key is updated" so I cannot use GetAsyncKeyState.
>>
>> I could probably use GetKeyboardState to make the program simpler but since I fixed it, I am probably not going to change it for a while :).
>
> I love how comprehensive this is. Including the resources is just brilliant. Thanks for sharing!

Generally speaking the win api is pretty complete documentation-wise. Many communities could actually learn from MS in this regard ☀️
Next ›   Last »
1 2