public DeviceMap_Axis1D CreateAxis1DMap(DeviceMapConfig_Axis1D config, Axis1D axis) { var result = new DeviceMap_Axis1D(); result.invertSrc = config.invertSrc; result.axisSrc = axes1D_backing[config.axis1D_Src]; result.axisDst = axis; return(result); }
/// <summary> /// Searches for Trigger config name. (returns null if not found) /// </summary> /// <param name="trigger">Trigger part of this Gamepad</param> /// <returns>Trigger name</returns> public string GetTriggerName(Axis1D trigger) { foreach (var map in triggerNameMaps) { if (map.axis == trigger) { return(map.name); } } return(null); }
/// <summary> /// Create physical buttons, axes, etc /// </summary> protected void CreatePhysicalObjects(int buttonCount, int axis1DCount, int axis2DCount, int axis3DCount, int sliderCount, int povCount) { buttons = new ReadOnlyArray <Button>(buttonCount, out buttons_backing); for (int i = 0; i != buttonCount; ++i) { buttons_backing[i] = new Button(); } axes1D = new ReadOnlyArray <Axis1D>(axis1DCount, out axes1D_backing); for (int i = 0; i != axis1DCount; ++i) { axes1D_backing[i] = new Axis1D(Axis1DUpdateMode.Bidirectional); } axes2D = new ReadOnlyArray <Axis2D>(axis2DCount, out axes2D_backing); for (int i = 0; i != axis2DCount; ++i) { axes2D_backing[i] = new Axis2D(); } axes3D = new ReadOnlyArray <Axis3D>(axis3DCount, out axes3D_backing); for (int i = 0; i != axis3DCount; ++i) { axes3D_backing[i] = new Axis3D(); } sliders = new ReadOnlyArray <Slider>(sliderCount, out sliders_backing); for (int i = 0; i != sliderCount; ++i) { sliders_backing[i] = new Slider(); } povDirections = new ReadOnlyArray <uint>(povCount, out povDirections_backing); for (int i = 0; i != povCount; ++i) { povDirections_backing[i] = uint.MaxValue; } }
public Axis1DNameMap(Axis1D axis, string name) { this.axis = axis; this.name = name; }