Merge pull request #10123 from bojidar-bg/7695-key-kp-enter

Rename KEY_RETURN to KEY_ENTER and KEY_ENTER to KEY_KP_ENTER
This commit is contained in:
Juan Linietsky 2017-08-06 21:04:11 -03:00 committed by GitHub
commit 134b3edf5a
18 changed files with 33 additions and 33 deletions

View File

@ -67,8 +67,8 @@ static _GlobalConstant _global_constants[] = {
BIND_GLOBAL_CONSTANT(KEY_TAB),
BIND_GLOBAL_CONSTANT(KEY_BACKTAB),
BIND_GLOBAL_CONSTANT(KEY_BACKSPACE),
BIND_GLOBAL_CONSTANT(KEY_RETURN),
BIND_GLOBAL_CONSTANT(KEY_ENTER),
BIND_GLOBAL_CONSTANT(KEY_KP_ENTER),
BIND_GLOBAL_CONSTANT(KEY_INSERT),
BIND_GLOBAL_CONSTANT(KEY_DELETE),
BIND_GLOBAL_CONSTANT(KEY_PAUSE),

View File

@ -219,11 +219,11 @@ void InputMap::load_default() {
add_action("ui_accept");
key.instance();
key->set_scancode(KEY_RETURN);
key->set_scancode(KEY_ENTER);
action_add_event("ui_accept", key);
key.instance();
key->set_scancode(KEY_ENTER);
key->set_scancode(KEY_KP_ENTER);
action_add_event("ui_accept", key);
key.instance();

View File

@ -42,8 +42,8 @@ static const _KeyCodeText _keycodes[] = {
{KEY_TAB ,"Tab"},
{KEY_BACKTAB ,"BackTab"},
{KEY_BACKSPACE ,"BackSpace"},
{KEY_RETURN ,"Return"},
{KEY_ENTER ,"Enter"},
{KEY_KP_ENTER ,"Kp Enter"},
{KEY_INSERT ,"Insert"},
{KEY_DELETE ,"Delete"},
{KEY_PAUSE ,"Pause"},
@ -294,8 +294,8 @@ bool keycode_has_unicode(uint32_t p_keycode) {
case KEY_TAB:
case KEY_BACKTAB:
case KEY_BACKSPACE:
case KEY_RETURN:
case KEY_ENTER:
case KEY_KP_ENTER:
case KEY_INSERT:
case KEY_DELETE:
case KEY_PAUSE:

View File

@ -57,8 +57,8 @@ enum KeyList {
KEY_TAB = SPKEY | 0x02,
KEY_BACKTAB = SPKEY | 0x03,
KEY_BACKSPACE = SPKEY | 0x04,
KEY_RETURN = SPKEY | 0x05,
KEY_ENTER = SPKEY | 0x06,
KEY_ENTER = SPKEY | 0x05,
KEY_KP_ENTER = SPKEY | 0x06,
KEY_INSERT = SPKEY | 0x07,
KEY_DELETE = SPKEY | 0x08,
KEY_PAUSE = SPKEY | 0x09,

View File

@ -925,10 +925,10 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("application/config/use_shared_user_dir", true);
key.instance();
key->set_scancode(KEY_RETURN);
key->set_scancode(KEY_ENTER);
va.push_back(key);
key.instance();
key->set_scancode(KEY_ENTER);
key->set_scancode(KEY_KP_ENTER);
va.push_back(key);
key.instance();
key->set_scancode(KEY_SPACE);

View File

@ -846,10 +846,10 @@
<constant name="KEY_BACKSPACE" value="16777220">
Backspace Key
</constant>
<constant name="KEY_RETURN" value="16777221">
<constant name="KEY_ENTER" value="16777221">
Return Key (On Main Keyboard)
</constant>
<constant name="KEY_ENTER" value="16777222">
<constant name="KEY_KP_ENTER" value="16777222">
Enter Key (On Numpad)
</constant>
<constant name="KEY_INSERT" value="16777223">

View File

@ -42,8 +42,8 @@ void EditorNameDialog::_line_gui_input(const Ref<InputEvent> &p_event) {
return;
switch (k->get_scancode()) {
case KEY_ENTER:
case KEY_RETURN: {
case KEY_KP_ENTER:
case KEY_ENTER: {
if (get_hide_on_ok())
hide();

View File

@ -573,7 +573,7 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) {
switch (k->get_scancode()) {
case KEY_RETURN: {
case KEY_ENTER: {
_open_project();
} break;

View File

@ -83,7 +83,7 @@ static _HaikuTranslatePair _fn_to_keycode[] = {
static _HaikuTranslatePair _hb_to_keycode[] = {
{ KEY_BACKSPACE, B_BACKSPACE },
{ KEY_TAB, B_TAB },
{ KEY_RETURN, B_RETURN },
{ KEY_ENTER, B_RETURN },
{ KEY_CAPSLOCK, B_CAPS_LOCK },
{ KEY_ESCAPE, B_ESCAPE },
{ KEY_SPACE, B_SPACE },

View File

@ -249,7 +249,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_RETURN:
case DOM_VK_ENTER: // unused according to MDN
return KEY_RETURN;
return KEY_ENTER;
case DOM_VK_SHIFT: return KEY_SHIFT;
case DOM_VK_CONTROL: return KEY_CONTROL;

View File

@ -518,7 +518,7 @@ static int translateKey(unsigned int key) {
/* 21 */ KEY_BRACELEFT,
/* 22 */ KEY_I,
/* 23 */ KEY_P,
/* 24 */ KEY_RETURN,
/* 24 */ KEY_ENTER,
/* 25 */ KEY_L,
/* 26 */ KEY_J,
/* 27 */ KEY_APOSTROPHE,
@ -558,7 +558,7 @@ static int translateKey(unsigned int key) {
/* 49 */ KEY_UNKNOWN, /* VolumeDown */
/* 4a */ KEY_UNKNOWN, /* Mute */
/* 4b */ KEY_KP_DIVIDE,
/* 4c */ KEY_ENTER,
/* 4c */ KEY_KP_ENTER,
/* 4d */ KEY_UNKNOWN,
/* 4e */ KEY_KP_SUBTRACT,
/* 4f */ KEY_UNKNOWN,

View File

@ -44,7 +44,7 @@ static _WinTranslatePair _vk_to_keycode[] = {
//VK_CLEAR (0x0C)
{ KEY_RETURN, VK_RETURN }, //(0x0D)
{ KEY_ENTER, VK_RETURN }, //(0x0D)
{ KEY_SHIFT, VK_SHIFT }, //(0x10)

View File

@ -807,7 +807,7 @@ void OS_Windows::process_key_events() {
if ((ke.lParam & (1 << 24)) && (ke.wParam == VK_RETURN)) {
// Special case for Numpad Enter key
k->set_scancode(KEY_ENTER);
k->set_scancode(KEY_KP_ENTER);
} else {
k->set_scancode(KeyMappingWindows::get_keysym(ke.wParam));
}

View File

@ -44,7 +44,7 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
{ XK_Tab, KEY_TAB },
{ XK_ISO_Left_Tab, KEY_BACKTAB },
{ XK_BackSpace, KEY_BACKSPACE },
{ XK_Return, KEY_RETURN },
{ XK_Return, KEY_ENTER },
{ XK_Insert, KEY_INSERT },
{ XK_Delete, KEY_DELETE },
{ XK_Clear, KEY_DELETE },
@ -78,7 +78,7 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
{ XK_Help, KEY_HELP },
{ XK_KP_Space, KEY_SPACE },
{ XK_KP_Tab, KEY_TAB },
{ XK_KP_Enter, KEY_ENTER },
{ XK_KP_Enter, KEY_KP_ENTER },
{ XK_Home, KEY_HOME },
{ XK_Left, KEY_LEFT },
{ XK_Up, KEY_UP },

View File

@ -229,8 +229,8 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
bool handled = true;
switch (code) {
case KEY_ENTER:
case KEY_RETURN: {
case KEY_KP_ENTER:
case KEY_ENTER: {
emit_signal("text_entered", text);
if (OS::get_singleton()->has_virtual_keyboard())

View File

@ -249,8 +249,8 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
}
}
} break;
case KEY_RETURN:
case KEY_ENTER: {
case KEY_ENTER:
case KEY_KP_ENTER: {
if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator) {

View File

@ -1805,7 +1805,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
if (k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_RETURN || k->get_scancode() == KEY_TAB) {
if (k->get_scancode() == KEY_KP_ENTER || k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_TAB) {
_confirm_completion();
accept_event();
@ -1974,8 +1974,8 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
switch (k->get_scancode()) {
case KEY_ENTER:
case KEY_RETURN: {
case KEY_KP_ENTER:
case KEY_ENTER: {
if (readonly)
break;

View File

@ -1917,8 +1917,8 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
void Tree::_text_editor_modal_close() {
if (Input::get_singleton()->is_key_pressed(KEY_ESCAPE) ||
Input::get_singleton()->is_key_pressed(KEY_ENTER) ||
Input::get_singleton()->is_key_pressed(KEY_RETURN)) {
Input::get_singleton()->is_key_pressed(KEY_KP_ENTER) ||
Input::get_singleton()->is_key_pressed(KEY_ENTER)) {
return;
}
@ -2237,8 +2237,8 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
} break;
case KEY_F2:
case KEY_RETURN:
case KEY_ENTER: {
case KEY_ENTER:
case KEY_KP_ENTER: {
if (selected_item) {
//bring up editor if possible