drkitt / godot-input-buffer Goto Github PK
View Code? Open in Web Editor NEWMore responsive input in Godot
Home Page: https://godotengine.org/asset-library/asset/1506
License: MIT License
More responsive input in Godot
Home Page: https://godotengine.org/asset-library/asset/1506
License: MIT License
I can't get the addon to work in version 4.2.1 stable official [b09f793f5] it's just not detecting the key presses, i think the function calls changed, i tried to fix it but couldn't.
Just wondering, since the method signature is _is_action_press_buffered(action)
, shouldn't this script only care about events that are assigned to actions in the InputMap
? And if so, couldn't you get rid of most of the conditional logic in the keycode checking etc? So it could all be simplified to a dictionary of action names?
Something like this
extends Node
const BUFFER_WINDOW: int = 150
var buffer: Dictionary = {}
func _input(event: InputEvent) -> void:
var action: StringName = _get_event_action(event)
if action:
buffer[action] = Time.get_ticks_msec()
func is_action_pressed_buffered(action: StringName) -> bool:
if buffer.has(action):
return Time.get_ticks_msec() - buffer[action] <= BUFFER_WINDOW
return false
func _get_event_action(event: InputEvent) -> StringName:
var actions: Array[StringName] = InputMap.get_actions()
var event_action: StringName
actions.reverse()
for action in actions:
if !event_action && event.is_action(action):
event_action = action
return event_action
Hello, I found this addon and it was really useful for my projects! :)
Since I am working with Godot 4 for on one of them, I forked your repo and made the following changes:
InputEventJoypadMotion
events to support gamepad joystick bufferingI could open a PR to merge these changes if you're ok with it, but I didn't want to do it on main
before asking since it would break 3.x compatibility
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.