I need help writing a keyboard event handler in VBA.
Posted: Sat Mar 19, 2022 3:30 pm
I need help writing a keyboard event handler in VBA.
I'm trying to write a macro that will interact with the mouse and keyboard. I found a GREAT forum post where Josh Brady posted some code that works great with the mouse using GetMouse. In this example, if the mouse is clicked, a dialog comes up with the mouse position (X, Y). I'd like to add a listener to it where it listens for a keyboard click as well. For example, if a key is pressed and that key is ESC, then it will end the macro.
Here's a link to the post where Josh Brady's shared his code. It's a MUST READ for anyone who is trying to learn how to handle the mouse.
"Help with mouse clicks"
https://r1132100503382-eu1-3dswym.3dexp ... mDUWtXrSog
I'm trying to write a macro that will interact with the mouse and keyboard. I found a GREAT forum post where Josh Brady posted some code that works great with the mouse using GetMouse. In this example, if the mouse is clicked, a dialog comes up with the mouse position (X, Y). I'd like to add a listener to it where it listens for a keyboard click as well. For example, if a key is pressed and that key is ESC, then it will end the macro.
Here's a link to the post where Josh Brady's shared his code. It's a MUST READ for anyone who is trying to learn how to handle the mouse.
"Help with mouse clicks"
https://r1132100503382-eu1-3dswym.3dexp ... mDUWtXrSog