Page 1 of 1

Re: Hold Shift to constrain movement

PostPosted: Sat Apr 21, 2012 9:09 am
by dpayer
70mach1 wrote:It would be nice if NeoBook would constrain movement of objects to horizontal or vertical if you hold down the Shift key.

Currently when holding down Shift, the objects move diagonally which is not very useful.


I could not get the following to work with the shift key as it cannot be used as a shortcut key but I did get this to work using two other shortcut keys to turn on and turn off the function.

Create a pub with two buttons (they can be off page) and a timer.
Button #1 "Turn on" make shortcut key : Control-A
Give the actions:
Code: Select all
GetMousePos "[Xmouse]" "[Ymouse]"
SetVar "[lockYvalue]" "[Ymouse]"
TimerStart "MouseTimer" "2"


Button #2 "Turn off" make shortcut key: Control-Q
Give Actions:
Code: Select all
TimerStop "MouseTimer"


Timer #1 "Mousetimer": set to "wait for timer start"
Give the actions:
Code: Select all
GetMousePos "[MouseX]" "[MouseY]"
SetMousePos "[MouseX]" "[lockYvalue]"


When you run the app, click Control-A and at that point your mouse will stay on the same "Y" level. Click Control-Q to stop.

You could play around to find a suitable means to turn on/off this function.

David P

PostPosted: Sat Apr 21, 2012 10:49 am
by Gaev
70mach1:

In the Editor (Design) Mode ... if I want to move an object, all I do is use one of the arrow keys ... makes the selected object move left/right/up/down by 1 pixel.

On the other hand, holding the Shift Key by itself does nothing ... but holding the Shift Key down and using the arrow keys moves the object 8 pixels in the direction of the arrow (probably because my Grid Spacing (in Options >> Grid Settings) is 8 pixels in both directions.

PostPosted: Sat Apr 21, 2012 2:44 pm
by Luiz Alfredo
Besides what David said, if you hold the Shift Key in design mode you can have diagonal, horizontal and vertical lines, perfect squares and perfect circles.

I do not understand what you mean with horizontal and vertical constrain. As David explained you can do this only using the arrow keys.