Is there a way to check if the space bar and at the same time track what direction the mouse is moving and how far etc.
Point of this is that I want to replicate how Photoshop scrolls when you hold the space bar, left mouse button and you move the mouse, but without having to hold down the left mouse button.
You can use
keydown()andkeyup()to track if the space bar is pressed or not and look at that state in yourmousemove()event handler. For example:And then your
mousemove()handler can see if it’s pressed or not.