public void SetInput(CapturedInput input, bool alreadyMapped) { Controller.Virtual.CancelCapture(); if (input == null) { lblSlot.Text = ""; Value = null; return; } if (alreadyMapped) previousMapping = input.Clone(); input = input.Clone(); bool error = false; if (input.IsAxisGesture) { string name = "Unknown Axis"; string dir = "Unknown direction"; var slot = Controller.Virtual.GetAxis(input.Axis).GetPole(input.AxisGesture).GetGesture(input.ButtonGesture); name = Util.GetStickDisplayName(input.Axis); dir = Util.GetAxisGestureName(input.Axis, input.IsPositive); lblSlot.Text = "Slot: " + name + " (" + dir + ")"; if (slot != null && previousMapping != input) { lblSlot.Text += ", which is already assigned to " + Util.GetActionName(slot) + ". This action will be replaced."; error = true; } } else { string name = input.Button.ToString(); if (input.Button == VirtualController.Button.Bl) name = "Left Bumper"; if (input.Button == VirtualController.Button.Br) name = "Right Bumper"; if (input.Button == VirtualController.Button.Tl) name = "Left Trigger"; if (input.Button == VirtualController.Button.Tr) name = "Right Trigger"; lblSlot.Text = "Slot: " + name; } if (error) { lblSlot.Font = new Font(lblSlot.Font, FontStyle.Regular); lblSlot.ForeColor = Color.Maroon; } else { lblSlot.Font = new Font(lblSlot.Font, FontStyle.Regular); lblSlot.ForeColor = Control.DefaultForeColor; } if ((int)input.ButtonGesture != this.gestureBox.SelectedIndex) this.gestureBox.SelectedIndex = (int)input.ButtonGesture; Value = input; }