Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | scarletred012 |
Hi, so I am trying to make it possible to when I hit “enter” on a particular item, it does the same thing as it would do if I clicked on that item.
I tried to do something like this
get_node("area2dnode").emit_signal("input_event")
but unfortunately that didn’t work… any suggestions on how I’d do this?
If you need additional information I’d be happy to give it, but I’m not sure what else would be useful here.
What would be a situation where you would have this behavior? Would the user have the choice of either using a mouse, or using the arrow keys on the keyboard, to select the item?
Ertain | 2020-09-10 23:30
Yes. I’d like full freedom for the user to use what they feel more comfortable with. Its a turn based RPG and a user can either click Attack then click on an enemy, or select attack with the keyboard and selecting an enemy with the keyboard as well.
I actually ended up writing a function that both the enter button and the area click signal both call. This seems to work.
scarletred012 | 2020-09-11 00:01