コード例 #1
0
 protected override void OnKeyDown(ESRI.ArcGIS.Desktop.AddIns.Tool.KeyEventArgs arg)
 {
     if (arg.KeyCode == Keys.Escape) //ESC is pressed
     {
         bCancel = true;
     }
 }
コード例 #2
0
 protected override void OnKeyUp(ESRI.ArcGIS.Desktop.AddIns.Tool.KeyEventArgs arg)
 {
     if (inUse == true)
     {
         //Slow down the speed of the fly through
         if (arg.KeyCode == Keys.Down || arg.KeyCode == Keys.Left)
         {
             motion = motion / 2;
         }
         //Speed up the speed of the fly through
         else if (arg.KeyCode == Keys.Up || arg.KeyCode == Keys.Right)
         {
             motion = motion * 2;
         }
         else if (arg.KeyCode == Keys.Escape)
         {
             bCancel = true;
         }
     }
 }
コード例 #3
0
        protected override void OnKeyUp(ESRI.ArcGIS.Desktop.AddIns.Tool.KeyEventArgs arg)
        {
            base.OnKeyUp(arg);

            try
            {
                if (arg.KeyCode == Keys.A)
                {
                    int hn = CalculateHouseNumber(CurrentPos);
                    if (hn > 0)
                    {
                        AddCallout(intersectionPoint, hn.ToString());
                        //ShowCallout(CurrentPos, hn.ToString());
                    }
                }
                if (arg.KeyCode == Keys.E)
                {
                    RemoveCallouts();
                }
            }
            catch { }
        }