Hello everyone! I would like there to be more efficient commands for editing text in the game.
Therefore I think that we add a few commonly used keyboard shortcuts when editing text in fields.
Fields is are the places where the player can enter text, this includes console, messagemode, UI-textboxes and such.
Currently these commands are available:Navigation:
left - one character left
right - one character right
home, ctrl-a - go to beginning of line
end, ctrl-e - go to end of line
Editing:
insert - overstrike toggle
delete - forward delete
backspace, ctrl-h - backward delete
ctrl-ins, ctrl-v - paste (doesn't appear work on linux though)
ctrl-c - clear entire line
Console specific:
tab - autocomplete command
ctrl-l - clear screen
up, shift-mwheelup, ctrl-p - previous command in history
down, shift-mwheeldown, ctrl-n - next command in history
ctrl-home - scroll to beginning of console
ctrl-end - scroll to end of console
Other:
enter - send command
Ideas of commands we can addCurrently the keyboard commands available are a mix between what I call "GUI style"-commands (like ctrl-home, ctrl-v, etc) and "UNIX CLI style"-commands (ctrl-a, ctrl-p, ctrl-h, etc).
I propose we add more commands that are expected when working with "GUI Style" and "UNIX CLI Style" keyboard interfaces.
For "GUI style"-commands I think that these should be added:
ctrl-left - put cursor on previous word
ctrl-right - put cursor on next word
ctrl-backspace - delete previous word
ctrl-delete - delete next word
For "UNIX style"-commands I think that these should be added:
ctrl-u - delete to beginning of line
ctrl-k - delete to end of line
ctrl-d - same as delete
ctrl-w - delete previous "large word"
alt-d - delete next word
ctrl-b - go the previous char
alt-b - go to to previous word
ctrl-f - go the next char
alt-f - go to to next word
I have made some test-changes to the engine code that implements these commands the for console and messagemodes. Implementing the commands for UI-fields (like the place where you pick a player name) should also be added but the code for that is in gamecode and independent of the engine-code.
I made a quick and boring youtube-demo of moving and deleting by words:
https://youtu.be/AuBjUDfLK9QWhat do you think?Do you agree or disagree?
Do you have any suggestions about the commands?