mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-21 18:47:53 -05:00
input_common: Allow keyboard to be backwards compatible
This commit is contained in:
@ -609,7 +609,7 @@ int GRenderWindow::QtKeyToSwitchKey(Qt::Key qt_key) {
|
||||
return Settings::NativeKeyboard::ZenkakuHankaku;
|
||||
// Modifier keys are handled by the modifier property
|
||||
default:
|
||||
return 0;
|
||||
return Settings::NativeKeyboard::None;
|
||||
}
|
||||
}
|
||||
|
||||
@ -662,8 +662,10 @@ void GRenderWindow::keyPressEvent(QKeyEvent* event) {
|
||||
// Replace event->key() with event->nativeVirtualKey() since the second one provides raw key
|
||||
// buttons
|
||||
const auto key = QtKeyToSwitchKey(Qt::Key(event->key()));
|
||||
input_subsystem->GetKeyboard()->SetModifiers(moddifier);
|
||||
input_subsystem->GetKeyboard()->PressKey(key);
|
||||
input_subsystem->GetKeyboard()->SetKeyboardModifiers(moddifier);
|
||||
input_subsystem->GetKeyboard()->PressKeyboardKey(key);
|
||||
// This is used for gamepads
|
||||
input_subsystem->GetKeyboard()->PressKey(event->key());
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,8 +673,10 @@ void GRenderWindow::keyReleaseEvent(QKeyEvent* event) {
|
||||
if (!event->isAutoRepeat()) {
|
||||
const auto moddifier = QtModifierToSwitchModdifier(event->nativeModifiers());
|
||||
const auto key = QtKeyToSwitchKey(Qt::Key(event->key()));
|
||||
input_subsystem->GetKeyboard()->SetModifiers(moddifier);
|
||||
input_subsystem->GetKeyboard()->ReleaseKey(key);
|
||||
input_subsystem->GetKeyboard()->SetKeyboardModifiers(moddifier);
|
||||
input_subsystem->GetKeyboard()->ReleaseKeyboardKey(key);
|
||||
// This is used for gamepads
|
||||
input_subsystem->GetKeyboard()->ReleaseKey(event->key());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,15 +344,6 @@ void Config::ReadDebugValues() {
|
||||
|
||||
void Config::ReadKeyboardValues() {
|
||||
ReadBasicSetting(Settings::values.keyboard_enabled);
|
||||
|
||||
for (std::size_t i = 0; i < Settings::values.keyboard_keys.size(); ++i) {
|
||||
Settings::values.keyboard_keys[i] = InputCommon::GenerateKeyboardParam(static_cast<int>(i));
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i < Settings::values.keyboard_mods.size(); ++i) {
|
||||
Settings::values.keyboard_mods[i] =
|
||||
InputCommon::GenerateModdifierKeyboardParam(static_cast<int>(i));
|
||||
}
|
||||
}
|
||||
|
||||
void Config::ReadMouseValues() {
|
||||
|
Reference in New Issue
Block a user