Page 1 of 1

Keyboard shortcuts in mods?

PostPosted: Wed Feb 19, 2014 16:11
by spillz
Is is possible to define keyboard shortcuts that perform an action in a mod?

The main thing I am thinking about is making some tweaks to WorldEdit to make it a bit less cumbersome to work with regions.

PostPosted: Wed Feb 19, 2014 16:12
by webdesigner97
No, I already suggested this, but it lags on multiplayer servers...

PostPosted: Wed Feb 19, 2014 16:16
by spillz
webdesigner97 wrote:No, I already suggested this, but it lags on multiplayer servers...


WorldEdit lags or keyboard shortcuts in general cause lag? Not sure why the latter would be true but will take your word for it.

PostPosted: Wed Feb 19, 2014 16:37
by webdesigner97
spillz wrote:
webdesigner97 wrote:No, I already suggested this, but it lags on multiplayer servers...


WorldEdit lags or keyboard shortcuts in general cause lag? Not sure why the latter would be true but will take your word for it.

Adding lua-handled keyboard bindings. The information about the key being pressed needs to be sent to the server, the function to be called will be executed and the result sent back.

PostPosted: Wed Feb 19, 2014 16:50
by spillz
webdesigner97 wrote:
spillz wrote:
webdesigner97 wrote:No, I already suggested this, but it lags on multiplayer servers...


WorldEdit lags or keyboard shortcuts in general cause lag? Not sure why the latter would be true but will take your word for it.

Adding lua-handled keyboard bindings. The information about the key being pressed needs to be sent to the server, the function to be called will be executed and the result sent back.


But that isn't any different from clicking a menu button, right? (which you can do now in mod). I guess it would be harder to spam the server with menu clicks than with key presses, but maybe there's a simple work around for that (ignore repeated key press until the previous key press is acknowledged by server.)

PostPosted: Wed Feb 19, 2014 17:04
by webdesigner97
spillz wrote:
webdesigner97 wrote:
spillz wrote:
WorldEdit lags or keyboard shortcuts in general cause lag? Not sure why the latter would be true but will take your word for it.

Adding lua-handled keyboard bindings. The information about the key being pressed needs to be sent to the server, the function to be called will be executed and the result sent back.


But that isn't any different from clicking a menu button, right? (which you can do now in mod). I guess it would be harder to spam the server with menu clicks than with key presses, but maybe there's a simple work around for that (ignore repeated key press until the previous key press is acknowledged by server.)

Maybe. The devs would need to think about this... I would really appreciate custom keys for mods!

Edit: Here is the topic where I suggested this. https://forum.minetest.net/viewtopic.php?id=7238

PostPosted: Thu Feb 20, 2014 23:32
by spillz
Thinking me more about this -- an easy way to allow keyboard shortcuts is to make them aliases for chat commands. Then nothing needs to change on the server side, just need a simple system for converting keypresses (including perhaps Ctrl-/Alt- combinations of keypresses) into chat commands.