Macro Question - Detecting Physical Keyboard Keypress
Posted: 29 Apr 2017 22:05
Is there a way to determine if a key on the physical keyboard is being pressed? There are functions to detect modifier keys, but I don't see one for regular keyboard input and feel like I'm just missing it.
What I want to do is create a macro that will first move the mouse pointer to a certain location on the screen, then drop into a while loop that stays true as long as a certain key is being pressed. Inside of the loop it'll issue a mouse scroll wheel command. When the key is no longer pressed it'll exit the loop and exit the macro.
That macro will get assigned to the physical key that gets detected.. So for example, to lower the velocity of the selected midi note you'd have the macro move the mouse to the Velocity setting in the Info line and then assign the macro that will scroll the mouse wheel down to the 'z' key, and to raise velocity assign the macro that scrolls the mouse wheel up to the 'x' key.. Then just hold down one or the other key to raise and lower the velocity (which isn't available in Cubase key commands). I'm able to get this to work as a one-shot, so I have to keep pressing the key over and over again. What I want to do is be able to hold down that key and have the mouse scroll event repeatedly triggered.
BTW.. I have a variation on this idea that uses the modifier key functions.. The macro first moves the mouse pointer to the Velocity setting, then the CTRL key lowers the velocity, and ALT raises it, SHIFT exits the macro. I've assigned that macro to the 'v' key. You can hold down CTRL and ALT keys and it works great, the velocity settings goes up and down, but it'd be a quicker process if they were just assigned to two keys without having to first launch the macro with a different key. Combined with other Cubase key commands it gives you full control over the most important midi editing functions with just a few physical keys!
What I want to do is create a macro that will first move the mouse pointer to a certain location on the screen, then drop into a while loop that stays true as long as a certain key is being pressed. Inside of the loop it'll issue a mouse scroll wheel command. When the key is no longer pressed it'll exit the loop and exit the macro.
That macro will get assigned to the physical key that gets detected.. So for example, to lower the velocity of the selected midi note you'd have the macro move the mouse to the Velocity setting in the Info line and then assign the macro that will scroll the mouse wheel down to the 'z' key, and to raise velocity assign the macro that scrolls the mouse wheel up to the 'x' key.. Then just hold down one or the other key to raise and lower the velocity (which isn't available in Cubase key commands). I'm able to get this to work as a one-shot, so I have to keep pressing the key over and over again. What I want to do is be able to hold down that key and have the mouse scroll event repeatedly triggered.
BTW.. I have a variation on this idea that uses the modifier key functions.. The macro first moves the mouse pointer to the Velocity setting, then the CTRL key lowers the velocity, and ALT raises it, SHIFT exits the macro. I've assigned that macro to the 'v' key. You can hold down CTRL and ALT keys and it works great, the velocity settings goes up and down, but it'd be a quicker process if they were just assigned to two keys without having to first launch the macro with a different key. Combined with other Cubase key commands it gives you full control over the most important midi editing functions with just a few physical keys!