mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 14:58:41 -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user