From 5c4e4716b67b796ed966c6ecbca820f581c1d8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 25 Jun 2019 21:35:20 +0200 Subject: [PATCH 1/3] Android: Add DPAD_CENTER as an accept button. Fixes menu navigation on Mi Box and Shield Remote. --- Common/KeyMap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 15ec6d8f6f..291c424b8c 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -303,6 +303,7 @@ void UpdateNativeMenuKeys() { KeyDef(DEVICE_ID_KEYBOARD, NKCODE_SPACE), KeyDef(DEVICE_ID_KEYBOARD, NKCODE_ENTER), KeyDef(DEVICE_ID_ANY, NKCODE_BUTTON_A), + KeyDef(DEVICE_ID_PAD_0, NKCODE_DPAD_CENTER), // A number of Android devices. }; // If they're not already bound, add them in. From 7de49c66a14536af2942820bfdaebac558de58a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 25 Jun 2019 21:35:54 +0200 Subject: [PATCH 2/3] Warning fix --- Common/Vulkan/VulkanContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Vulkan/VulkanContext.cpp b/Common/Vulkan/VulkanContext.cpp index 76c67ff9ed..10c4c4de32 100644 --- a/Common/Vulkan/VulkanContext.cpp +++ b/Common/Vulkan/VulkanContext.cpp @@ -851,7 +851,7 @@ bool VulkanContext::InitQueue() { // Get the list of VkFormats that are supported: uint32_t formatCount = 0; VkResult res = vkGetPhysicalDeviceSurfaceFormatsKHR(physical_devices_[physical_device_], surface_, &formatCount, nullptr); - _assert_msg_(G3D, res == VK_SUCCESS, "Failed to get formats for device %p: %d surface: %p", physical_devices_[physical_device_], (int)res, surface_); + _assert_msg_(G3D, res == VK_SUCCESS, "Failed to get formats for device %d: %d", physical_device_, (int)res); if (res != VK_SUCCESS) { return false; } From c5b9e9f7187c202e74a4124736f8e157e35f2eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 25 Jun 2019 21:36:18 +0200 Subject: [PATCH 3/3] Comment some confusing code --- ext/native/ui/view.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index 378290f951..cd62fa7f4a 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -364,6 +364,8 @@ bool IsDPadKey(const KeyInput &key) { bool IsAcceptKey(const KeyInput &key) { if (confirmKeys.empty()) { + // This path is pretty much not used, confirmKeys should be set. + // TODO: Get rid of this stuff? if (key.deviceId == DEVICE_ID_KEYBOARD) { return key.keyCode == NKCODE_SPACE || key.keyCode == NKCODE_ENTER || key.keyCode == NKCODE_Z; } else { @@ -376,6 +378,8 @@ bool IsAcceptKey(const KeyInput &key) { bool IsEscapeKey(const KeyInput &key) { if (cancelKeys.empty()) { + // This path is pretty much not used, cancelKeys should be set. + // TODO: Get rid of this stuff? if (key.deviceId == DEVICE_ID_KEYBOARD) { return key.keyCode == NKCODE_ESCAPE || key.keyCode == NKCODE_BACK; } else { @@ -388,6 +392,8 @@ bool IsEscapeKey(const KeyInput &key) { bool IsTabLeftKey(const KeyInput &key) { if (tabLeftKeys.empty()) { + // This path is pretty much not used, tabLeftKeys should be set. + // TODO: Get rid of this stuff? return key.keyCode == NKCODE_BUTTON_L1; } else { return MatchesKeyDef(tabLeftKeys, key); @@ -396,6 +402,8 @@ bool IsTabLeftKey(const KeyInput &key) { bool IsTabRightKey(const KeyInput &key) { if (tabRightKeys.empty()) { + // This path is pretty much not used, tabRightKeys should be set. + // TODO: Get rid of this stuff? return key.keyCode == NKCODE_BUTTON_R1; } else { return MatchesKeyDef(tabRightKeys, key); @@ -408,6 +416,7 @@ bool Clickable::Key(const KeyInput &key) { return false; } // TODO: Replace most of Update with this. + bool ret = false; if (key.flags & KEY_DOWN) { if (IsAcceptKey(key)) { @@ -958,7 +967,7 @@ bool TextEdit::Key(const KeyInput &input) { if (!HasFocus()) return false; bool textChanged = false; - // Process navigation keys. These aren't chars. + // Process hardcoded navigation keys. These aren't chars. if (input.flags & KEY_DOWN) { switch (input.keyCode) { case NKCODE_CTRL_LEFT: