private void Button1_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(textBox1.Text) || !IsFileNameValid(textBox1.Text)) { MessageBox.Show("不合法的名称!"); return; } DefaultMapConfig config = null; if (this.comboBox1.SelectedIndex == 0) { config = new KeyBoardConfig(); } else if (this.comboBox1.SelectedIndex == 1) { config = new XInputConfig(); } else { config = new MixModeConfig(); } config.Name = textBox1.Text; this.OnSuccess(config); this.Close(); }
public ScriptJoyMap(DefaultMapConfig _config) : base(_config) { KeyBoardConfig = new KeyBoardConfig(); XinputConfig = new XInputConfig(); Scripts = new Dictionary <int, string>(); config = _config; }
///// <summary> ///// 虚拟手柄的BYTE信号缓冲区 ///// </summary> //byte[] XinputKeyBuffer { get; set; } = new byte[4]; //byte[] XinputLTriggerBuffer { get; set; } = new byte[1]; //byte[] XinputRTriggerBuffer { get; set; } = new byte[1]; //byte[] XinputLRemoteXBuffer { get; set; } = new byte[1]; //byte[] XinputLRemoteYBuffer { get; set; } = new byte[1]; //byte[] XinputRRemoteXBuffer { get; set; } = new byte[1]; //byte[] XinputRRemoteYBuffer { get; set; } = new byte[1]; ///// <summary> ///// 键盘的BYTE信号缓冲区 ///// </summary> //byte[] KeyBoardKeyBuffer { get; set; } = new byte[4]; //byte[] KeyBoardLTriggerBuffer { get; set; } = new byte[1]; //byte[] KeyBoardRTriggerBuffer { get; set; } = new byte[1]; //byte[] KeyBoardLRemoteXBuffer { get; set; } = new byte[1]; //byte[] KeyBoardLRemoteYBuffer { get; set; } = new byte[1]; //byte[] KeyBoardRRemoteXBuffer { get; set; } = new byte[1]; //byte[] KeyBoardRRemoteYBuffer { get; set; } = new byte[1]; public MixModeJoyMap(DefaultMapConfig _config) : base(_config) { if (_config == null) { _config = new XInputConfig(); } KeyBoardConfig = new DefaultMapConfig(); XinputConfig = new DefaultMapConfig(); config = _config; }