string GetUseKeyString(PlayerControlsGamepad.E_Input command) { string keyString = null; GamepadInputManager.Instance.SetConfig(Game.CurrentJoystickName()); JoyInput inputButton = GamepadInputManager.Instance.GetActionButton(command); if (inputButton.key != KeyCode.None || inputButton.joyAxis != E_JoystickAxis.NONE) { keyString = GuiPopupGamepadConfig.GetButtonLabel(inputButton); } #if MADFINGER_KEYBOARD_MOUSE GamepadInputManager.Instance.SetConfig("Keyboard"); JoyInput inputKey = GamepadInputManager.Instance.GetActionButton(command); if (inputKey.key != KeyCode.None || inputKey.joyAxis != E_JoystickAxis.NONE) { if (string.IsNullOrEmpty(keyString)) { keyString = GuiPopupGamepadConfig.GetButtonLabel(inputKey); } else { keyString = GuiPopupGamepadConfig.GetButtonLabel(inputKey) + ", " + keyString; } } #endif return(keyString); }
void OnKeyboardPressed(bool inside) { if (inside == false) { return; } if (Owner == null) { return; } GuiPopupGamepadConfig popup = (GuiPopupGamepadConfig)Owner.ShowPopup("GamepadConfig", "", "", null); popup.IsForKeyboard = true; }
void OnGamepadPressed(bool inside) { if (inside == false) { return; } if (Owner == null) { return; } //Owner.ShowScreen("custom_inputs"); GuiPopupGamepadConfig popup = (GuiPopupGamepadConfig)Owner.ShowPopup("GamepadConfig", "", "", null); popup.IsForKeyboard = false; }