#Input.get_joy_button_string replacement?

1 messages · Page 1 of 1 (latest)

weary sinew
#

I used this method (and Input.get_joy_axis_string) for generating key rebinding UI in Godot 3 but it appears that the method doesn't exist in 4. What's the current way to access button names from the button indexes?

vestal badge
#

Yo. Also interested in this. Have you found out anything about this yet @weary sinew ? Was this functionality abandoned?

weary sinew
vestal badge
#

just checked 3.5 code and it seems to be just a table lookup

#

i guess we can just copy that

#

wonder why it was removed

weary sinew
#

reimplementing it isn't too hard but i do wonder that as well

#

i'll close this as solved tomorrow if no one has more insight on the change

vestal badge
#

we can still get the string with InputEvent.as_text(), though it's a different longer string

#

and there's no inverse operation "from_text", like there was before for get_joy_button_index_from_string

#

i guess that still needs to be re-implemented

weary sinew
#

oh wow that was from 2020

#

well i can see what as_text displays and either use it or roll my own

#

thanks for digging this up

vestal badge
#

yeah, not clear why they decided to remove the string and from_string methods, but i guess we're on our own!