public FakeAnalogController(int portNum)
 {
     PortNum    = portNum;
     Definition = new ControllerDefinition
     {
         BoolButtons = BaseBoolDefinition
                       .Select(b => "P" + PortNum + " " + b)
                       .ToList(),
         AxisControls = { "P" + PortNum + " Disc X", "P" + PortNum + " Disc Y" },
         AxisRanges   = ControllerDefinition.CreateAxisRangePair(-127, 0, 127, ControllerDefinition.AxisPairOrientation.RightAndUp)               //TODO verify direction against hardware
     };
 }
Beispiel #2
0
 public AnalogControls(int portNum)
 {
     PortNum    = portNum;
     Definition = new ControllerDefinition
     {
         Name        = "Vectrex Analog Controller",
         BoolButtons = BaseDefinition
                       .Select(b => "P" + PortNum + " " + b)
                       .ToList(),
         AxisControls = { "P" + PortNum + " Stick X", "P" + PortNum + " Stick Y" },
         AxisRanges   = ControllerDefinition.CreateAxisRangePair(-128, 0, 127, ControllerDefinition.AxisPairOrientation.RightAndUp)
     };
 }
 public StandardTilt(int portNum)
 {
     PortNum    = portNum;
     Definition = new ControllerDefinition
     {
         Name        = "Gameboy Controller + Tilt",
         BoolButtons = BaseDefinition
                       .Select(b => "P" + PortNum + " " + b)
                       .ToList(),
         FloatControls = { "P" + PortNum + " Tilt X", "P" + PortNum + " Tilt Y" },
         FloatRanges   = ControllerDefinition.CreateAxisRangePair(-45, 0, 45, ControllerDefinition.AxisPairOrientation.RightAndUp)               //TODO verify direction against hardware
     };
 }
Beispiel #4
0
        public static ControllerDefinition CreateControllerDefinition(SyncSettings syncSettings)
        {
            ControllerDefinition definition = new ControllerDefinition();

            definition.Name = "LibRetro Controls";             // <-- for compatibility

            foreach (var item in new[] {
                "P1 {0} Up", "P1 {0} Down", "P1 {0} Left", "P1 {0} Right", "P1 {0} Select", "P1 {0} Start", "P1 {0} Y", "P1 {0} B", "P1 {0} X", "P1 {0} A", "P1 {0} L", "P1 {0} R",
                "P2 {0} Up", "P2 {0} Down", "P2 {0} Left", "P2 {0} Right", "P2 {0} Select", "P2 {0} Start", "P2 {0} Y", "P2 {0} B", "P2 {0} X", "P2 {0} A", "P2 {0} L", "P2 {0} R",
            })
            {
                definition.BoolButtons.Add(string.Format(item, "RetroPad"));
            }

            definition.BoolButtons.Add("Pointer Pressed");             //TODO: this isnt showing up in the binding panel. I don't want to find out why.
            definition.AxisControls.Add("Pointer X");
            definition.AxisControls.Add("Pointer Y");
            definition.AxisRanges.AddRange(ControllerDefinition.CreateAxisRangePair(-32767, 0, 32767, ControllerDefinition.AxisPairOrientation.RightAndUp));

            foreach (var key in new[] {
                "Key Backspace", "Key Tab", "Key Clear", "Key Return", "Key Pause", "Key Escape",
                "Key Space", "Key Exclaim", "Key QuoteDbl", "Key Hash", "Key Dollar", "Key Ampersand", "Key Quote", "Key LeftParen", "Key RightParen", "Key Asterisk", "Key Plus", "Key Comma", "Key Minus", "Key Period", "Key Slash",
                "Key 0", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5", "Key 6", "Key 7", "Key 8", "Key 9",
                "Key Colon", "Key Semicolon", "Key Less", "Key Equals", "Key Greater", "Key Question", "Key At", "Key LeftBracket", "Key Backslash", "Key RightBracket", "Key Caret", "Key Underscore", "Key Backquote",
                "Key A", "Key B", "Key C", "Key D", "Key E", "Key F", "Key G", "Key H", "Key I", "Key J", "Key K", "Key L", "Key M", "Key N", "Key O", "Key P", "Key Q", "Key R", "Key S", "Key T", "Key U", "Key V", "Key W", "Key X", "Key Y", "Key Z",
                "Key Delete",
                "Key KP0", "Key KP1", "Key KP2", "Key KP3", "Key KP4", "Key KP5", "Key KP6", "Key KP7", "Key KP8", "Key KP9",
                "Key KP_Period", "Key KP_Divide", "Key KP_Multiply", "Key KP_Minus", "Key KP_Plus", "Key KP_Enter", "Key KP_Equals",
                "Key Up", "Key Down", "Key Right", "Key Left", "Key Insert", "Key Home", "Key End", "Key PageUp", "Key PageDown",
                "Key F1", "Key F2", "Key F3", "Key F4", "Key F5", "Key F6", "Key F7", "Key F8", "Key F9", "Key F10", "Key F11", "Key F12", "Key F13", "Key F14", "Key F15",
                "Key NumLock", "Key CapsLock", "Key ScrollLock", "Key RShift", "Key LShift", "Key RCtrl", "Key LCtrl", "Key RAlt", "Key LAlt", "Key RMeta", "Key LMeta", "Key LSuper", "Key RSuper", "Key Mode", "Key Compose",
                "Key Help", "Key Print", "Key SysReq", "Key Break", "Key Menu", "Key Power", "Key Euro", "Key Undo"
            })
            {
                definition.BoolButtons.Add(key);
                definition.CategoryLabels[key] = "RetroKeyboard";
            }

            return(definition);
        }