示例#1
0
 public static void Map(PadTieForm form, VirtualController vc, CapturedInput slot, InputAction action)
 {
     if (slot.IsAxisGesture) {
         form.MapAxisGesture(vc,
             slot.Axis,
             slot.IsPositive ? AxisActions.Gestures.Positive : AxisActions.Gestures.Negative,
             slot.ButtonGesture,
             action);
     } else {
         var gesture = slot.ButtonGesture;
         form.MapButton(vc, slot.Button, gesture, action);
     }
 }
示例#2
0
        public void EditAction(InputAction action)
        {
            if (action == null)
                return;

            var cc = this.controller;
            if (action is KeyAction)
                new MapKeystrokeForm(mainForm, cc, action as KeyAction).ShowDialog(this);
            else if (action is MouseButtonAction)
                new MapMouseButtonForm(mainForm, cc, action as MouseButtonAction).ShowDialog(this);
            else if (action is MousePointerAction)
                new MapPointerForm(mainForm, cc, action as MousePointerAction).ShowDialog(this);
            else if (action is MouseWheelAction)
                new MapMouseWheelForm(mainForm, cc, action as MouseWheelAction).ShowDialog(this);
            else if (action is RunCommandAction)
                new MapCommandDialog(mainForm, cc, action as RunCommandAction).ShowDialog(this);
            else if (action is OpenFileAction)
                new MapOpenFileDialog(mainForm, cc, action as OpenFileAction).ShowDialog(this);
            else
                MessageBox.Show("Error: This version of Pad Tie is not able to edit actions of type " + action.GetType().Name);
        }
示例#3
0
 public void Map(Gesture g, InputAction action)
 {
     switch (g) {
         case Gesture.Link:
             Link = action;
             break;
         case Gesture.Tap:
             Tap = action;
             break;
         case Gesture.DoubleTap:
             DoubleTap = action;
             break;
         case Gesture.Hold:
             Hold = action;
             break;
         default:
             throw new NotSupportedException("Unknown gesture '" + g + "'");
     }
 }
示例#4
0
 public ForwardAction(InputAction a)
 {
     Action = a;
 }
示例#5
0
 public void ClearAction(InputAction action)
 {
     if (action == null) return;
     MapUtil.Map(mainForm, controller.Virtual, action.SlotDescription, null);
     currentMappings_AfterSelect(currentMappings, null);
 }
示例#6
0
        public void SetMapping(string id, string text, InputAction action)
        {
            var n = buttonMapNodes[id];
            if (n.ToolTipText == "")
                n.ToolTipText = n.Text;

            n.Text = n.ToolTipText + ": " + text;
            n.Tag = action;
        }