0
votes

I'm trying to setup some hotkeys so I can use my tablet and stylus for Zbrush in a left handed setup more easily.

Basically, I want to start emulating my mouse and modifier navigation with the arrow keys.

so far what I have works. right mouse for orbit, middle for pan.

I am trying to figure out how to add a modifier key (ctrl) to the right mouse click and hold so while I hover the stylus and move it the zoom function works.

I need:

left arrow key = ctrl+right mouse hold

Thanks!

Here's my code so far:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.



 #IfWinActive, ahk_class ZBrush

 #MaxHotkeysPerInterval 200


Numpad0::f ;frame

Up::Space


; Use the Down Arrow as middle mouse button

Down::  ;Down Arrow Button
click Down middle ;click middle mousebutton and hold
keywait, Down ; wait until key is released.
click Up middle ; release middle mousebutton


; Use the Right Arrow Button as right mouse button

Right::  ;right Arrow Button
click Down right ;click right mousebutton and hold
keywait, Right ; wait unitl key is released
click Up right ; release right mousebutton


    return
2
Does it only need to hold ctrl down for the right-click press? Or does it need held down for the entire duration that the right-click is held down? Also, I noticed that you used Alt in your solution; is that what you wanted instead of Ctrl?EJE
ctrl needs to be held down the whole time. In fact the action is this: Hold ctrl down, hold right mouse button down, move mouse to zoom, release right mouse, release ctrl. Using Alt is a secondary way to Zoom in Zbrush: Hold Alt down, right mouse down, release Alt, move mouse to zoom , release right mouse.RK Stille

2 Answers

0
votes

I don't have an application that ctrl + right-click does anything, so I couldn't fully test it. See if this works:

left::
Send , {ctrl down}
Click , down , right
Return

left up::
Send , {ctrl up}
Click , up , right
Return
0
votes

I gave that a try and for some reason it seemed like ctrl was still sticking and causing problems although it seems to work in other applications. Since this question was ZBrush specific I'll add what became my solution for zooming in and out with hovering stylus movement while holding down the left arrow:

Left::

Send, {Alt Down}
click Down right
Send, {Alt Up}
Keywait, Left
click Up right
return

Not sure if I need the Keywait or not but it seems to work