How do you remap shortcuts for the "Home" and "End" keys?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gnagent

Hi,

In the integrated Godot editor, the “Home” key scrolls to the top of the file and the “End” key to the bottom. Years of ingrained muscle-memory has got me pressing “Home” to go to the start of the line and “End” to go to the end of the line. I can’t stop pressing these keys – I do it without even thinking as I need to move around – and of course, jumping away from the function I’m writing is not what I want to do!

I’ve looked through “Editor Settings” “Shortcuts” for any reference to the Home and End keys, but I find nothing. Is there some way to remap these keys? If not (which would be really disappointing) is there some way to completely disable them? Doing nothing would be far better than jumping to the top or bottom of the file every couple minutes!

(I’ve even tried using an external editor just so that I can have the Home/End keys work as I’m used to them, but I’ve run into too many issues with improper/unrecognized indenting and the lack of debugging support, so switching to an external editor doesn’t seem to be a solution. I really just want to control the Home and End keys.)

Thanks in advance for any help!

:bust_in_silhouette: Reply From: fpicoral

I may be wrong but I don’t think that this is a feature. What you can do is go to yours keyboard software and disable these keys.
If you hava a Razer keyboard, you can even create a profile that have these keys disabled and set to automatically change to this profile when the Godot Engine .exe starts (you probably can do the same with other brands, I’m just not 100% sure since my keyboard is from Razer).

:bust_in_silhouette: Reply From: RohMin

Unfortunately there’s no feature that I know of that does this. I’ve been searching around for a solution but became fed up and dug through the source code. In scene/gui/text_edit.cpp, you can make the following changes and recompile.

On line 3008, replace the line with cursor_set_column(0);
On line 3071, replace the line with cursor_set_column(text[cursor.line].length());

That will make the HOME and END keys jump to the beginning and end of the line.