Godot: BaseButton's Shortcut system doesn't work with InputEventActions

Created on 22 Jan 2018  路  12Comments  路  Source: godotengine/godot

Godot version:
f4d6743

Issue description:
Maybe I don't know how to set it properly, but I have asked others and I have yet to find someone who had made it work.

In my case, I'm trying to use it with an InputEventAction, but no reaction in-game whatsoever.

bug core

Most helpful comment

Since I've been here twice, for those using 3.0 and waiting for 3.1, here's a workaround, though it won't work with multiple keys with the same action:

  1. Create a InputEventKey instead
  2. Look up @GlobalScope find your key (Ctrl+F and enter KEY_*)
    Example: KEY_1 is 49, KEY_2 is 50 (above the Q key) and so on
  3. Enter that code into the Scancode property
  4. You're done!

image

All 12 comments

Do you have a sample project?

@vnen Sorry for using a thirdparty site, put GitHub isn't accepting the zip for some reason:
https://www.file-upload.com/arm2g2b2wnsa

The button is set to print "Pressed" and its shortcut is set as "ui_accept", so pressing enter should trigger it, but it doesn't.

Uploaded here to make it easier for others: test.zip

It doesn't work with actions.

@vnen Then why it's possible to use an InputEventAction?

I don't know if it was supposed to work with actions or not, I was just saying that the current state is that it doesn't work.

@vnen Oh, sorry.
Yeah, it seems that thing like InputEventKey works, changing the title to represent the issue better then.

Since I've been here twice, for those using 3.0 and waiting for 3.1, here's a workaround, though it won't work with multiple keys with the same action:

  1. Create a InputEventKey instead
  2. Look up @GlobalScope find your key (Ctrl+F and enter KEY_*)
    Example: KEY_1 is 49, KEY_2 is 50 (above the Q key) and so on
  3. Enter that code into the Scancode property
  4. You're done!

image

Hi guys, I set the shortcut with InputEventKey, even if it does the same action as the button has been pressed... why it doesn't activate the pressed texture on my Button?

Why does it want a path? Does it want a filepath to a new .gd file? Why isn't it showing me Pressed, Scancode, Unicode, Echo, etc. like the above screenshot?
image

@vince94 Click InputEventKey.

At first it just opened this menu again -
image

But I figured it out. I'm so used to vanilla WinForms that I never considered that clicking the dropdown arrow would have a different result than clicking the middle of the control :/

Is there documentation for what scancodes are?

Was this page helpful?
0 / 5 - 0 ratings