Here’s the answer to #1
install this tool by doing this at startup for your GoView (view1)
view1.DefaultTool = new ToolManagerNoScrollOnArrowKey(view1);
// allow arrow keys to move selection, but don't update DocPosition to keep object in view. (i.e. no autoscroll)
[Serializable]
public class ToolManagerNoScrollOnArrowKey : GoToolManager
{
public ToolManagerNoScrollOnArrowKey(GoView v) : base(v) { }
public override void DoKeyDown()
{
GoInputEventArgs evt = this.LastInput;
bool control = evt.Control;
bool shift = evt.Shift;
GoViewDisableKeys cant = this.View.DisableKeys;
System.Windows.Forms.Keys key = evt.Key;
if (key == System.Windows.Forms.Keys.Up || key == System.Windows.Forms.Keys.Down ||
key == System.Windows.Forms.Keys.Left || key == System.Windows.Forms.Keys.Right)
{
float dx = 0;
float dy = 0;
switch (key)
{
case System.Windows.Forms.Keys.Left: dx = -1; break;
case System.Windows.Forms.Keys.Right: dx = 1; break;
case System.Windows.Forms.Keys.Up: dy = -1; break;
case System.Windows.Forms.Keys.Down: dy = 1; break;
}
if (!this.View.Selection.IsEmpty && this.View.CanMoveObjects() && ((cant & GoViewDisableKeys.ArrowMove) == 0))
{
float f = 1;
if (control)
{
f = this.View.ArrowMoveSmall;
}
else
{
f = this.View.ArrowMoveLarge;
}
GoToolDragging dragtool = this.View.FindMouseTool(typeof(GoToolDragging), true) as GoToolDragging;
if (dragtool != null)
{
GoSelection effsel = dragtool.ComputeEffectiveSelection(this.View.Selection, true);
this.View.MoveSelection(effsel, new SizeF(dx * f, dy * f), true);
this.View.RaiseSelectionMoved();
}
}
else
{
base.DoKeyDown();
}
}
else
{
base.DoKeyDown();
}
}
}