Page 1 of 1

Keyboard shortcuts for chat commands

PostPosted: Tue Mar 18, 2014 02:55
by spillz
Here's a bit of fun...

Apply the attached patch

and try out some keyboard shortcuts in your minetest.conf (the last 3 are for worldedit)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#set time to day
keymap_alias_daytime = KEY_MULTIPLY
keymap_command_daytime = time 06000
#set worldedit pos1
keymap_alias_pos1 = KEY_HOME
keymap_command_pos1 = /pos1
#set worldedit pos2
keymap_alias_pos2 = KEY_END
keymap_command_pos2 = /pos2
#set all nodes to air between pos 1 and pos2
keymap_alias_airnode = KEY_DELETE
keymap_command_airnode = /set air


Add your own and see what you can come up with... (I've asked Uberi to add a bunch of commands to world edit -- e.g. I would love to use arrow keys + pg up, pg dn to move markers around)

Here's the TODO list:
1. Allow modifiers (e.g. checking for CTRL, SHIFT, ALT etc)
2. Add user interface
3. Create Lua API hooks so that mods can register default keys for certain actions, but allow user to override them.

Happy to take suggestions. Devs, please let me know if this is the right approach.

PostPosted: Tue Mar 18, 2014 06:49
by 4aiman
3. Create Lua API hooks so that mods can register default keys for certain actions, but allow user to override them.


This one was the subject of a major disturbance once :)
Should be get_player_controls extended by 3-4 more auxiliary keys?
Anyway, that's probably a protocol bump...

PostPosted: Tue Mar 18, 2014 19:49
by spillz
For something like worldedit, 3-4 keys is limiting. My approach has the advantages of being very simple to implement, because it uses the existing chat command infrastructure, robust, because it uses the existing chat command infrastructure, and flexible, because ...

What was the disturbance?

PostPosted: Wed Apr 09, 2014 03:17
by spillz
New "keyboard shortcuts for chat commands" patch is attached. This update adds GUI and supports keyboard modifiers (CTRL/SHIFT). Still some quirks to be worked out.

GUI Screenshot (the red box is to show you what's new)

Image

PostPosted: Mon Apr 14, 2014 16:43
by bajanhgk
THAT'S AWESOME but ammmmm where to put the keymap 2 and please don't tell me i have to go to lua and delete some codes cause i don't have anything to open lua

PostPosted: Mon Apr 14, 2014 20:27
by JPRuehmann
no Word? lol
JPR

PostPosted: Mon Apr 14, 2014 21:22
by spillz
This is now a pull request on github (#1217).

If accepted, you will be able to use the keyboard settings gui to set your commands. No lua or minetest.conf editing required. But until it is accepted you will have to apply the patch and compile mt yourself to use it.