private void InitUI() { InputsMgr.eInputName inputName = (InputsMgr.eInputName)GameBoy.Parameters.inputName; if (inputName == InputsMgr.eInputName.e_inputName_keyboard) { m_inputs[(int)InputsMgr.e_buttons.btn_A] = GameBoy.Parameters.inputA; m_inputs[(int)InputsMgr.e_buttons.btn_B] = GameBoy.Parameters.inputB; m_inputs[(int)InputsMgr.e_buttons.btn_Start] = GameBoy.Parameters.inputStart; m_inputs[(int)InputsMgr.e_buttons.btn_Select] = GameBoy.Parameters.inputSelect; m_inputs[(int)InputsMgr.e_buttons.btn_up] = GameBoy.Parameters.inputUp; m_inputs[(int)InputsMgr.e_buttons.btn_down] = GameBoy.Parameters.inputDown; m_inputs[(int)InputsMgr.e_buttons.btn_left] = GameBoy.Parameters.inputLeft; m_inputs[(int)InputsMgr.e_buttons.btn_right] = GameBoy.Parameters.inputRight; } else { AInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_A]); BInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_B]); StartInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_Start]); SelectInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_Select]); UpInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_up]); DownInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_down]); LeftInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_left]); RightInput.Text = GamepadButtonFlagToString(m_inputs[(int)InputsMgr.e_buttons.btn_right]); } }
private void OnInputChanged(object sender, EventArgs e) { m_currentInput = (InputsMgr.eInputName)GameBoy.Parameters.inputName; if (m_currentInput != eInputName.e_inputName_none) { if (m_currentInput == eInputName.e_inputName_keyboard) { m_k_up = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputUp); m_k_down = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputDown); m_k_left = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputLeft); m_k_right = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputRight); m_k_A = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputA); m_k_B = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputB); m_k_start = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputStart); m_k_select = (Key)KeyInterop.KeyFromVirtualKey((int)GameBoy.Parameters.inputSelect); } else { UserIndex i = UserIndex.Any; switch (m_currentInput) { case InputsMgr.eInputName.e_inputName_gamepad_1: { i = UserIndex.One; break; } case InputsMgr.eInputName.e_inputName_gamepad_2: { i = UserIndex.Two; break; } case InputsMgr.eInputName.e_inputName_gamepad_3: { i = UserIndex.Three; break; } case InputsMgr.eInputName.e_inputName_gamepad_4: { i = UserIndex.Four; break; } } m_gamepad = new Xbox360Controller.Gamepad360(i); m_p_up = (GamepadButtonFlags)GameBoy.Parameters.inputUp; m_p_down = (GamepadButtonFlags)GameBoy.Parameters.inputDown; m_p_left = (GamepadButtonFlags)GameBoy.Parameters.inputLeft; m_p_right = (GamepadButtonFlags)GameBoy.Parameters.inputRight; m_p_A = (GamepadButtonFlags)GameBoy.Parameters.inputA; m_p_B = (GamepadButtonFlags)GameBoy.Parameters.inputB; m_p_start = (GamepadButtonFlags)GameBoy.Parameters.inputStart; m_p_select = (GamepadButtonFlags)GameBoy.Parameters.inputSelect; } } }
public ComboboxItem(string text, InputsMgr.eInputName value, bool bIsGamepad) { Text = text; Value = value; IsGamepad = bIsGamepad; }