/******************************************************************************** * FUNCTION: SetCurrent * Description: Sets the current input device file * Parameters: * device_guid - The GUID of the input device ********************************************************************************/ public void SetCurrent(String inputFileName) { if (inputFileName == InputFile || inputFileName == "Keyboard") { return; } if (JFS != null) { JFS.Close(); } JFS = new FileStream(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); currentDevice = new JoystickLx(); buff = new byte[8]; Name = inputFileName; InputFile = inputFileName; this.Poll(); full_scale = 65535; ChannelMapping = Helpers.DefaultJoystick; ChannelInverted = Enumerable.Repeat <bool>(false, (int)ChannelNumber.NUM_CHANNELS).ToArray(); }
public Controller(IntPtr Owner) { hWnd = Owner; currentDevice = null; Name = "NA"; full_scale = 100; ChannelMapping = null; CHANNEL = new int[(int)ChannelNumber.NUM_CHANNELS]; }