Simulating Drag or Click Lock for accessibility customization

I am using a track ball with a stream deck mounted infront of it. I am having difficulty with clicking and dragging so I am using keyboard maestro and the stream deck to create custom buttons. These button simulate click drag and shift click drag.

I set a hotkey switch in steam deck to trigger one keystroke to initiate the drag and then a second to tear down and stop the drag.

The initiate keystroke is all the modifier keys and a "u" and the tear down keystroke is Function 6.

The initiator starts a keyboard maestro script -

  1. Set Variable "ClickLock" to Text "Locked"
  2. Click and Hold at (0,0) from the Current Mouse Location
  3. Execute Actions Until Conditions Met
    3a) Move Mouse to (0,0) from the Current Mouse Location
    until ClickLock is Released

The tear down

  1. Set Variable "ClickLock" to Text "Released"

Using the " move mouse to where the mouse is" results in an updated UI in the apps I use to click drag in. I can see the boxes for selecting a range of files on the desktop. The OS is passed an "update position" or refresh screen if you will. I am assuming. Don't know why it works. It just works now and i'm not touching it.

The reason for using F6 to do the tear down is because if I used a modifier key to trigger the tear down it would be picked up by the OS and change the result. I had set the "tear down and stop drag" button of the stream deck to send an "all the modifier keys and d" but because the option and command were now pushed when the drop occurred the drag of a file would end up creating an alias. F6 seems to be unused most places so I assigned it.

I am doing the same with an option key and shift key being simulated as held down because sometimes I want to hold down option before mouse click lock and then release the option while still holding the mouse and then hold down the shift before releasing the mouse button. Weird specific edit function but useful when needed. I am having difficulty with adding modifier keys at different phases of the drag. I will keep you updated.

I am using complicated hot keys because I am using stream deck and use the buttons to send hot keys to keyboard maestro. I could see a person with limited finger usage and no streamedeck doing the following.

Set a semaphore state of the keyboard.
If command option D is pressed set keysRemappedToDragging to TRUE
If the keysRemappedToDragging is TRUE and Q is pressed then initiate drag
If the keysRemappedToDragging is TRUE and Y is pressed then initiate option hold down
(lots of drag combinations and mouse clicks can be mapped to the keyboard)
If spacebar is pressed set keysRemappedToDragging to FALSE and set ClickLock to false

Have you tried the KM Stream Deck Plugin? That would let you use the SD buttons as USB Device Key triggers rather than sending hot keys.

But the icing on the cake is that you can also set SD button images from your macro -- you can change the icon to show your "ClickLock" is currently operating, for example, then change it back on release.

1 Like