Skip to content

Commit

Permalink
Revert "prevent other hooks of keyDown from being triggered twice"
Browse files Browse the repository at this point in the history
This reverts commit 1f00646.

it made it worse actually oops
  • Loading branch information
matcool committed Feb 15, 2024
1 parent 1f00646 commit b1f2026
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/EditorUI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <Geode/modify/EditorPauseLayer.hpp>
#include <unordered_map>
Expand Down
8 changes: 2 additions & 6 deletions src/UILayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ struct $modify(PauseLayer) {

struct $modify(UILayer) {
static void onModify(auto& self) {
// These are negative because in this class we make a lot of use of the fallthrough trick,
// and if a mod hooks these functions (cough megahack), then their hook gets called twice.
// Doing this makes their hook only get called once, although `key` will be the key we are pretending to press,
// however i think its a fair compromise.
(void)self.setHookPriority("UILayer::keyDown", -1000);
(void)self.setHookPriority("UILayer::keyUp", -1000);
(void)self.setHookPriority("UILayer::keyDown", 1000);
(void)self.setHookPriority("UILayer::keyUp", 1000);
}

static inline int platformButton() {
Expand Down

0 comments on commit b1f2026

Please sign in to comment.