Ejemplo n.º 1
0
 void accelaratorKeyMap1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control)
     {
         if (ShortcutKeys.Haldle(e.KeyData))
         {
             e.SuppressKeyPress = true;
         }
     }
 }
Ejemplo n.º 2
0
        protected override void OnChartKeyDown(KeyEventArgs e)
        {
            base.OnChartKeyDown(e);

            //System.Diagnostics.Debug.WriteLine(string.Format("KeyCode:{0} Control:{1} Alt:{2} Shift:{3}", e.KeyCode, e.Control, e.Alt, e.Shift));
            //Keys keys = e.KeyCode;
            //if (e.Control)
            //    keys |= Keys.Control;
            //if (e.Shift)
            //    keys |= Keys.Shift;
            //if (e.Alt)
            //    keys |= Keys.Alt;

            //
            if (ShortcutKeys.Haldle(e.KeyData))
            {
                e.SuppressKeyPress = true;
                return;
            }

            if (e.Control && DragBox.Visible)
            {
                DragBox.Invalidate();
            }

            //{
            //    switch (e.KeyCode)
            //    {
            //        case Keys.Tab:
            //        case Keys.Insert:
            //            if (!ReadOnly)
            //            {
            //                AddSubTopic();
            //                e.SuppressKeyPress = true;
            //            }
            //            break;
            //        case Keys.Enter:
            //            if (!ReadOnly)
            //            {
            //                AddTopic();
            //                e.SuppressKeyPress = true;
            //            }
            //            break;
            //        case Keys.Space:
            //        case Keys.F2:
            //            if (!ReadOnly)
            //            {
            //                EditObject();
            //                e.SuppressKeyPress = true;
            //            }
            //            break;
            //        case Keys.Delete:
            //            DeleteObject();
            //            e.SuppressKeyPress = true;
            //            break;
            //        case Keys.Left:
            //            SelectNextTopic(MoveVector.Left);
            //            e.SuppressKeyPress = true;
            //            break;
            //        case Keys.Up:
            //            SelectNextTopic(MoveVector.Up);
            //            e.SuppressKeyPress = true;
            //            break;
            //        case Keys.Right:
            //            SelectNextTopic(MoveVector.Right);
            //            e.SuppressKeyPress = true;
            //            break;
            //        case Keys.Down:
            //            SelectNextTopic(MoveVector.Down);
            //            e.SuppressKeyPress = true;
            //            break;
            //        case Keys.Escape:
            //            if (MouseState == ChartMouseState.Drag)
            //            {
            //                CancelDrag();
            //                e.SuppressKeyPress = true;
            //            }
            //            break;
            //    }
            //}
        }