diff options
author | german77 <juangerman-13@hotmail.com> | 2021-11-14 10:45:07 -0600 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-24 20:30:28 -0600 |
commit | bca299e8e0489867f7d4bbfd264e221e7e61ae1e (patch) | |
tree | 312f145bfcaffa9b7ecc2710443fa3737bf379e4 /src/yuzu/bootmanager.cpp | |
parent | b673857d7dfc72f38d9242b315cd590b859795ff (diff) |
input_common: Allow keyboard to be backwards compatible
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 61513a5b4..9f4d1aac3 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -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()); } } |