Skip to content

Commit

Permalink
exempt numpad and lmouse from rebinding
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Aug 12, 2024
1 parent 320ecd2 commit cc80690
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ This is not a virus, but you probably shouldn't believe a random file on the int
- Take out the flute to play your song while in the room
- Keyboard remapping
- Disable all undocumented game keys and remap your own
- All hud elements should also display correctly for most keys
- All hud elements should also display correctly for most keys (all alphanumeric + space)
- Numpad is left untouched at the moment and works normally

### Mods

Expand Down
6 changes: 4 additions & 2 deletions max.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ GAME_INPUT IconToInput(BUTTON_ICON c) {
using KeyPressed = bool(uint8_t);
KeyPressed *g_key_pressed_trampoline{nullptr};
bool HookKeyPressed(uint8_t vk) {
if (!Max::get().use_keymap)
if (!Max::get().use_keymap || vk == VK_LBUTTON ||
(vk & VK_NUMPAD0) == VK_NUMPAD0)
return g_key_pressed_trampoline(vk);
auto mk = GetMappedKey(vk);
if (mk)
Expand All @@ -251,7 +252,8 @@ bool HookKeyPressed(uint8_t vk) {
using KeyDown = uint8_t(uint8_t);
KeyDown *g_key_down_trampoline{nullptr};
uint8_t HookKeyDown(uint8_t vk) {
if (!Max::get().use_keymap)
if (!Max::get().use_keymap || vk == VK_LBUTTON ||
(vk & VK_NUMPAD0) == VK_NUMPAD0)
return g_key_down_trampoline(vk);
auto mk = GetMappedKey(vk);
if (mk)
Expand Down

0 comments on commit cc80690

Please sign in to comment.