Godot: Better document the difference between KEY_ENTER and KEY_RETURN

Created on 1 Feb 2017  Â·  12Comments  Â·  Source: godotengine/godot

Operating system or device - Godot version:
Ubuntu, Godot 2.1.2

Issue description:

The scan codes for the Enter keys don't work.

Steps to reproduce:

func _ready():
    set_process_input(true);

func _input(ie):
    if ie.type == InputEvent.KEY:
        if ie.pressed && ie.scancode == KEY_ENTER:
            get_tree().call_deferred("quit");

Hitting enter and nothing happens.

Link to minimal example project:
:

documentation junior job core

Most helpful comment

despite the proper name, I also think it's less confusing to rename to KEY_ENTER and KEY_KP_ENTER . We are still in time if you want to change this before 3.0. Any volunteers?

All 12 comments

Use KEY_RETURN instead. We should clarify this for 3.0

Thanks!

Sorry about that.

On Feb 2, 2017 1:56 AM, "Rémi Verschelde" notifications@github.com wrote:

Reopened #7695 https://github.com/godotengine/godot/issues/7695.

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7695#event-945976171, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ARM3vGj90NXikShXrOOMeHaxgVEGtcvAks5rYX4KgaJpZM4Lzh-I
.

On 2.1.3, the global scope is:

KEY_RETURN = 16777221  Return Key (On Main Keyboard)
KEY_ENTER = 16777222  Enter Key (On Numpad)

Does it really need better documentation? I mean, I think it might be a good idea to rename the constants to something like KEY_ENTER and KEY_ENTER_ON_NUMPAD, but the documentation of what already exists it's ok already.

if you want to do this, feel free, but for now kicking to 3.1

@anakimluke

I mean, I think it might be a good idea to rename the constants to something like KEY_ENTER and KEY_ENTER_ON_NUMPAD.

I don't think that is a good idea at all. The proper name for that key is 'return'.
Personally I think it should stay as it is at the moment.
But if people really really want to change that, I will not start a "war" because of it.

@ni-code, Even if the name of the keys are _technically_ different, when I see both KEY_ENTER and KEY_RETURN, I think about the enter key on the main keyboard; then I guess that's how other people should see it too.

despite the proper name, I also think it's less confusing to rename to KEY_ENTER and KEY_KP_ENTER . We are still in time if you want to change this before 3.0. Any volunteers?

also it needs to be changed in keyboard.cpp in the list of key names

I can volunteer this :wink:

Kp for key lanel?
Since this is really rarely used i think a longer more descriptive name wod be better.
KEY_ENTER_NUMPAD.
If i search for it I would tyoe enter an autocomplete would tell me the rest...

@toger5 I discussed changing KP to NP or NUMPAD on IRC, but, as @Calinou mentioned, most other engines seem to use KP as well.

Was this page helpful?
0 / 5 - 0 ratings