Skip to content

Commit

Permalink
lets try android
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Jul 5, 2024
1 parent 2458460 commit 42ecfc1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 3 additions & 10 deletions src/UILayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -43,6 +43,7 @@ class $modify(CCEGLView){
CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods);
}
};
#endif

class $modify(CCKeyboardDispatcher) {
static inline std::unordered_set<enumKeyCodes> s_held {};
Expand Down

0 comments on commit 42ecfc1

Please sign in to comment.