Project Zomboid

Project Zomboid

68 ratings
BindAid - Input Handler
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
199.853 KB
10 Mar, 2023 @ 2:26pm
16 Mar, 2023 @ 11:31am
3 Change Notes ( view )

Subscribe to download
BindAid - Input Handler

Description
Supports B41+. Works in Multiplayer
A new save is not required



Input Binding Manager for Project Zomboid which provides optimizations for keyboard input events and additional Mouse button support with optional keyboard emulation.

Features
  • Keyboard Input Optimization
  • Modifier key Support (Currently for Modders. Now Syncs in MP!)
  • Additional Mouse Button Support
  • Mouse Button Keyboard Emulation
  • Autohide the Mouse Cursor
  • Easy API for Modders!

Modifier Key
By default, Left Control is set to be the "Aim" key with the keyboard. I believe the key can be put to better use, and intend to replace the key's usage to be a Modifier. I HIGHLY RECOMMEND that you unset the default "Aim" key to nothing (you have Right Click), or change the Modifier key to something else.

For now the Modifier key is mostly a Modder's tool, but in the future I plan on allowing vanilla keybindings to be set with the Modifier.

Mod Options

Mod Options is REQUIRED to configure this mod; however, it is not a requirement for its operation. When your first install this mod, please take some time to set up its configuration based on your own needs using Mod Options. Further information on the available options is available below.

When Mod Options is NOT enabled for a save, your configuration will still be read and applied. THIS MEANS Server Owners can safely include this mod without also requiring Mod Options, and user configuration will still be used.

Keyboard Input Optimization

A full breakdown is available here: BindAid's Keyboard Input Optimization - What It Be, and How It Do

In summary, there are 4 general events that are triggered for input handling, and each event will call multiple functions for each keypress.
Event
Trigger
# of Functions
OnKeyStartPressed
When a key is pressed
10
OnKeyKeepPressed
When a key is held, every frame
9
OnKeyPressed
When a key is released
26
OnCustomUIKey
When a key is released
1

This occurs for ALL keypresses, whether they have actions bound or not. Multiple keypresses multiply the number of functions called per frame. This is not an issue for most people, but I have organized and optimized how this is handled so only 1 function is called during the event, which then calls the keypress if applicable.

This feature can be disabled in the Mod Options configuration. If changed while in-game, a restart is required.

Compatibility

I have created this in a way that should have maximum compatibility. If you have any issues with a vanilla key not being triggered, I would recommend disabling this optimization and letting me know. I cannot fix all mod compatibility, and some may require changes by the Modders. For Modders, please see: BindAid - Modder's Resource

  • Mods that add their own NEW keys are not affected.
  • Mods that modify vanilla functions for keypresses will be compatible as long as their changes are made no later than OnGameStart, and any modifications are forwarded.

Mouse Buttons

That's right, BindAid provides support for additional Mouse Buttons! Project Zomboid provides support for an additional 6 Mouse Buttons, but only has events bound on Left and Right Click. I have added Events to handle more Mouse Buttons!

You will need to select the number of Mouse Buttons that you would like to have support for in the Mod Options. A restart of the game is required after you have made this change.

The Mouse Buttons have 2 different modes: Mouse Button Events (default) and Keyboard Emulation. An option is available to enable both methods to run as well.

Mouse Button Events

When Mouse Button Events are in use, the additional Mouse Buttons are handled similarly to keybind events. Modders can hook into these events to allow additional actions to be done on a Mouse Button Press/Hold/Release. Please see: BindAid - Modder's Resource

THIS MEANS, BY DEFAULT, MOUSE BUTTONS PERFORM NO NEW ACTIONS! MODDERS MUST ADD SUPPORT FOR THIS!

Keyboard Emulation

New in the "Key Bindings" Options Tab will be the Mouse Buttons that are supported under the "BindAid" section, each set to a key bind of "None". Setting a Key here on a Mouse Button will instead cause an emulated Keypress to be done instead of the Mouse Event! For example, you can bind "Reload" to the Middle Mouse Button.

NOTE!!! The Emulated Keypress is ONLY done in Lua, so it will not trigger functions defined in Java. This means you cannot assign a key to "Move Forward" or something like that; it won't work. Actions such as Reloading, Shout/Emote, and many others are available, as well as new keybinds added by other mods (the main target).

Workshop ID: 2945066057
Mod ID: BindAid
Popular Discussions View All (3)
8
28 Jun, 2024 @ 8:36am
Report Bugs Here
dhert
4
13 Mar, 2023 @ 1:03am
PINNED: BindAid - Modder's Resource
dhert
0
10 Mar, 2023 @ 2:31pm
PINNED: BindAid's Keyboard Input Optimization - What It Be, and How It Do
dhert
25 Comments
sneakyfildy 3 Jul @ 12:12pm 
ok so I made it work.
1. In the main menu go to MODS, select BindAid and ModOptions and click "enable" at the right panel
2. then in OPTIONS > Mods, "Run mouse and emulated events" - check (also I've unchecked auto-hide but I don't think it matters). I think it worth restarting the game after that,
3. OPTIONS > Key bindings, scroll to the very bottom. There I put "[" and "]" keys into "Mouse button 3" and "Mouse button 4" fields.
3. OPTIONS > Key bindings, For example "Inventory" - I set to "[" key (press on keyboard), it asks "remove/keep both" I choose "keep both", after that it starts to work in-game.
sneakyfildy 3 Jul @ 11:57am 
how to use it?
Fred 12 Jun @ 9:16am 
it does kinda work, I can bind R to middle mouse button and reload with it, or bind Q to Mouse 4 and shout/emote

but i cant bind the Fancy Handywork's modifier key to anything regardless of keyboard key it is, the mouse does nothing
LongNoseDog 8 Mar @ 7:02am 
how the hell do you even work this mod a tutorial would be greatly appreciated
Wiking 19 Dec, 2024 @ 6:17am 
Is this build42 compatible or will it need an update?
Avsky 2 Dec, 2024 @ 6:19pm 
I am trying to bind "backward" movement to mouse 4 or 5 but it does not work, can you please explain how to do it?
ItsBlade 11 Oct, 2024 @ 10:02am 
Tried setting it to the same key as my push-to-talk key. Straight up doesn't work. Using a Logitech G502 Lightspeed, neither of the mouse4 or mouse5 buttons work with the assigned keybinds
AndrewMV 3 Oct, 2024 @ 7:28pm 
A video tutorial on how to bind mouse buttons? Cuz this ain't working.
Kuba 9 Aug, 2024 @ 3:43am 
I can't get it to work, I can't assign any mouse buttons to do anything, could anyone walk me through how to do it properly?
KickPaw 31 Jul, 2024 @ 4:32am 
I can bind only one mouse button and it's possible to use fast forward but not manual floor attack button