示例#1
0
 public JoystickDeviceAdapter(JoystickEventArguments args)
 {
     JoystickID   = args.JoystickID;
     IsController = args.IsController;
     NumAxis      = args.NumAxes;
     NumButtons   = args.NumButtons;
     NumHats      = args.NumHats;
 }
示例#2
0
        private JoystickDeviceAdapter GetOrCreateDeviceAdapter(JoystickEventArguments args)
        {
            JoystickDeviceAdapter state;

            if (!_joysticks.TryGetValue(args.JoystickID, out state))
            {
                state = new JoystickDeviceAdapter(args);
                if (Page != null)
                {
                    state.AssignPage(Page);
                }
                _joysticks.Add(args.JoystickID, state);

                Page?.OnJoystickConnected(this, new JoystickConnectedEventArguments(args));
            }

            return(state);
        }