[gnome-games] retro-runner: Use input capabilities to set input mode
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro-runner: Use input capabilities to set input mode
- Date: Tue, 20 Nov 2018 01:43:41 +0000 (UTC)
commit 896aa494e642dc218ec001301a5698ec27c624a9
Author: Yetizone <andreii lisita gmail com>
Date: Thu Nov 15 09:56:17 2018 +0200
retro-runner: Use input capabilities to set input mode
src/retro/retro-runner.vala | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 6cf30bd4..7c985d10 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -319,7 +319,13 @@ public class Games.RetroRunner : Object, Runner {
}
public InputMode[] get_available_input_modes () {
- return { InputMode.GAMEPAD, InputMode.KEYBOARD };
+ if (input_capabilities == null)
+ return { InputMode.GAMEPAD };
+
+ if (input_capabilities.get_allow_keyboard_mode ())
+ return { InputMode.GAMEPAD, InputMode.KEYBOARD };
+ else
+ return { InputMode.GAMEPAD };
}
private void on_media_number_changed () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]