From 42ecfc111b1bd2c8cd33980461644f9fca89e19e Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:32:23 -0300 Subject: [PATCH] lets try android --- .github/workflows/build.yml | 12 ++++++------ CMakeLists.txt | 4 +++- mod.json | 5 +++-- src/UILayer.cpp | 13 +++---------- src/main.cpp | 3 ++- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b8380b..a4d2cae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,13 +18,13 @@ jobs: # - name: macOS # os: macos-latest - # - name: Android32 - # os: ubuntu-latest - # target: Android32 + - name: Android32 + os: ubuntu-latest + target: Android32 - # - name: Android64 - # os: ubuntu-latest - # target: Android64 + - name: Android64 + os: ubuntu-latest + target: Android64 name: ${{ matrix.config.name }} runs-on: ${{ matrix.config.os }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 63bd101..0e4d919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.5.0) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +set(CMAKE_CXX_VISIBILITY_PRESET hidden) -project(CustomKeybinds VERSION 1.2.2) +project(CustomKeybinds VERSION 1.6.5) file(GLOB SOURCES src/*.hpp diff --git a/mod.json b/mod.json index 1b4a66f..f7e1d76 100644 --- a/mod.json +++ b/mod.json @@ -1,9 +1,10 @@ { "geode": "3.1.1", "gd": { - "win": "2.206" + "win": "2.206", + "android": "2.206" }, - "version": "v1.6.4", + "version": "v1.6.5", "id": "geode.custom-keybinds", "name": "Custom Keybinds", "developer": "Geode Team", diff --git a/src/UILayer.cpp b/src/UILayer.cpp index caa9366..1c298a9 100644 --- a/src/UILayer.cpp +++ b/src/UILayer.cpp @@ -87,8 +87,7 @@ struct $modify(PauseLayer) { struct $modify(UILayer) { static void onModify(auto& self) { - (void)self.setHookPriority("UILayer::keyDown", 1000); - (void)self.setHookPriority("UILayer::keyUp", 1000); + (void)self.setHookPriority("UILayer::handleKeypress", 1000); } static inline int platformButton() { @@ -272,15 +271,9 @@ struct $modify(UILayer) { } static inline bool allowKeyDownThrough = false; - void keyDown(enumKeyCodes key) override { + void handleKeypress(cocos2d::enumKeyCodes key, bool down) { if (key == enumKeyCodes::KEY_Escape || allowKeyDownThrough) { - UILayer::keyDown(key); - allowKeyDownThrough = false; - } - } - void keyUp(enumKeyCodes key) override { - if (allowKeyDownThrough) { - UILayer::keyUp(key); + UILayer::handleKeypress(key, down); allowKeyDownThrough = false; } } diff --git a/src/main.cpp b/src/main.cpp index 144f5b1..ca218b9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,8 +19,8 @@ using namespace geode::prelude; using namespace keybinds; +#ifdef GEODE_IS_WINDOWS class $modify(CCEGLView){ - /** * GD does not pass shift into dispatchKeyboardMSG, causing the modifier to break when holding. * We need to manually pass in shift from onGLFWKeyCallback to resolve this bug. @@ -43,6 +43,7 @@ class $modify(CCEGLView){ CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods); } }; +#endif class $modify(CCKeyboardDispatcher) { static inline std::unordered_set s_held {};