Use keyboard to move the cursor in the command field

Hello.

I would like my arrow keys (or modified arrows keys like shift-left and shift-right) to control the cursor in the command field rather than nudge or rotate the view. I have searched, but not found a way to do this. I find it inconvenient to have to click for the position of the cursor when editing a command. For instance, if I am entering a coordinate point of 1,10/sin(32),20/sqrt(2) it is useful to use the arrow keys to move the cursor.

For reference, I’m on Rhino 8.

Thank you!

I have managed to get this to work with AutoHotKey v2.0. Below is the script. I currently have the functions mapped to Ctrl-Arrow. I have two sets of arrow keys in my keyboard setup, so I will map the second set to the modified Ctrl-Arrow keys.

You need to change the command window font to Lucida Console (because it is a fixed width font).

#Requires AutoHotkey v2.0

^Left::
{
if(WinActive(“ahk_exe rhino.exe”))
{
MouseGetPos &MouseX, &MouseY, &MouseWin, &MouseControl
if(CaretGetPos(&OutputVarX, &OutputVarY))
{
if(OutputVarY=141)
{
if(OutputVarX>81)
{
Click OutputVarX-7, OutputVarY
MouseMove MouseX, MouseY
}
}
else
{
Send “{Left}”
}
}
else
{
Click 1341, 141
MouseMove MouseX, MouseY
}
}
else
{
Send “{Left}”
}
}

^Right::
{
if(WinActive(“ahk_exe rhino.exe”))
{
MouseGetPos &MouseX, &MouseY, &MouseWin, &MouseControl
if(CaretGetPos(&OutputVarX, &OutputVarY))
{
if(OutputVarY=141)
{
Click OutputVarX+7, OutputVarY
MouseMove MouseX, MouseY
}
else
{
Send “{Right}”
}
}
else
{
Click 1341, 141
MouseMove MouseX, MouseY
}
}
else
{
Send “{Right}”
}
}

^Up::
{
if(WinActive(“ahk_exe rhino.exe”))
{
MouseGetPos &MouseX, &MouseY, &MouseWin, &MouseControl
if(CaretGetPos(&OutputVarX, &OutputVarY))
{
if(OutputVarY>0 && OutputVarY<=141)
{
Click OutputVarX, OutputVarY-12
MouseMove MouseX, MouseY
}
else
{
Send “{Up}”
}
}
else
{
Click 1341, 141
MouseMove MouseX, MouseY
}
}
else
{
Send “{Up}”
}
}

^Down::
{
if(WinActive(“ahk_exe rhino.exe”))
{
MouseGetPos &MouseX, &MouseY, &MouseWin, &MouseControl
if(CaretGetPos(&OutputVarX, &OutputVarY))
{
if(OutputVarY>=0 && OutputVarY<141)
{
Click OutputVarX, OutputVarY+12
Sleep 100
CaretGetPos(&OutputVarX2, &OutputVarY2)
if(OutputVarY2=OutputVarY)
{
if(OutputVarX<81)
{
Click 81,141
}
else
{
Click OutputVarX,141
}
}
MouseMove MouseX, MouseY
}
else if(OutputVarY=141)
{
}
else
{
Send “{Down}”
}
}
else
{
Click 1341, 141
MouseMove MouseX, MouseY
}
}
else
{
Send “{Down}”
}
}