Project Zomboid

Project Zomboid

64 ratings
BindAid - Input Handler
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
199.853 KB
Mar 10, 2023 @ 2:26pm
Mar 16, 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
Jun 28, 2024 @ 8:36am
Report Bugs Here
dhert
4
Mar 13, 2023 @ 1:03am
PINNED: BindAid - Modder's Resource
dhert
0
Mar 10, 2023 @ 2:31pm
PINNED: BindAid's Keyboard Input Optimization - What It Be, and How It Do
dhert
22 Comments
LongNoseDog Mar 8 @ 7:02am 
how the hell do you even work this mod a tutorial would be greatly appreciated
Wiking Dec 19, 2024 @ 6:17am 
Is this build42 compatible or will it need an update?
Avsky Dec 2, 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 Oct 11, 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 Oct 3, 2024 @ 7:28pm 
A video tutorial on how to bind mouse buttons? Cuz this ain't working.
Kuba Aug 9, 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 Jul 31, 2024 @ 4:32am 
I can bind only one mouse button and it's possible to use fast forward but not manual floor attack button
Mitsurugi Jun 28, 2024 @ 8:46am 
This mod is better than great! Took 2 seconds of trial and error to figure out which button was 3 and which was 4, but now I have reload and interact call/shout bound to the mouse. Only issue I found is that I can't seem to get "rack weapon" to work. I can bind the key but it doesn't seem to matter, it just wont do the action.

Either way, I have been looking for something like this for about a as long as I have been playing the game. Seriously, thanks so much for making this! It's crazy this mod isn't 5 stars.

I also really like spiffui and fancy handywork. You make some top notch mods. And appear to be an oldschool Oney fan.
ghost May 11, 2024 @ 3:38am 
I cant seem to figure out how to get this to work no matter what I do.
Broken Moon Apr 12, 2024 @ 6:33pm 
Gotta agree, they don't work.:/