(updated)
Problem
It's extremely frustrating to create a control scheme that allows the player to do a number of different things when we are limited to only a few keys for controls. There's an express need for an additional expansion to the PC and desktop control scheme and possibly mobile.
currently, we're limited to about 3 different keys (if you're generous) for non-movement (or other hard-coded action) controls. This is frustrating as if you want to make a special menu, a action key (like a special ability), or a movement key (like crouch, prone), this is very limiting, and especially considering shift and zoom already having an action. While you can be creative, this basically still limits you to one key for any given action, and since most servers use aux for sprint... you basically have nothing.
Solutions
See #12488 (comment)
Details
**PC/DESKTOP**
I propose two possible solutions (for PC)
Solution A: allow games to take matters into their own hands.
Allow mods to see the control binds of players, and see (almost) all pressed keys
this would be used to get key binds, this is so mods can plan around existing player key binds, and even create their own binding system
minetest.get_player_key_binds(player) = {forward = "w", left = "a" . . . etc}
this would be a list of active keys, if a key is active it should not be on the list. This list would exclude some keys, like windows button (and linux equivalent), the function keys, or anything else sensitive or not needed.
minetest.get_player_held_controls(player) = {w = true, a = true . . . etc}
these functions could alternatively be methods for the player object.
Best/adopted solution (for PC)
Solution B: allow game/world key binds
This would allow games to create their own custom key bind settings for each player, and allow the client to interface with it.
on joining, the player would receive a list of key binds, this would be directly interfaceable with the "change keys" button, this should be modifiable by the server in post. The client would store these key binds by server in a human readable file format. This is especially important as to allow players to copy across versions etc, these files also should never delete themselves.
mostly self explanitory:
the world keybinds would function as a sort of default
minetest.set_world_keybinds({keyname="key" . . . etc})
minetest.add_world_keybind(keyname, key)
minetest.on_player_change_keybinds(function(player, key, value))
(edit): a useful system to implement would also be the ability to send a request to get player keybinds...
this would allow the server to store the keybinds, and to replace current local keybinds for any reason (use case being if the client reinstalled, they wouldn't be screwed over.)
minetest.get_keybinds(playername)
minetest.send_keybinds(binds, playername) --returns true if accepted/unsuccessful, else false.
(during chat, or when a formspec is open, these would be ignored)
MOBILE
I propose one solution for mobile, this would be the addition of "buttons" to the HUD definition.
It's fairly simple actually:
the size of the button would be the same size as the image or text, just a box. The change would include this addition to the HUD definition:
button = function(player)
button_image = "image.png"
"button" would be called while the player presses down on it, when it's being pressed down upon, the image would change to button_image (if present). HOWEVER this system would require atleast 1 other PR(s)/issues to be put in place:
see relevant PRs:
#12264 user input mechanisms (for detecting touchpad) <---- most important, could be essential
#12367 window/screen size information (for better scaling)
If the inclusion of PR 12264 can not be made, HUD images with the button function should not be displayed on devices without capabilities to use them.
additional
Mobile (could) be delayed for obvious reasons
The engine does not currently have the framework to allow for the support of mobile in regards to controls... but this doesn't mean we should limit ourselves and not make improvements where we can.
We should improve PC control inputs and settings, and upgrade mobile options later, it's silly to limit ourselves to "X platform can't do Y so we should leave out this entirely basic feature for Z until we rework the entire engine".
Besides, games/mods that require additional controls are likely to hard to play on mobile, though I agree that's not our choice to make- it's the truth, and ignoring it is a massive oversight.
to reiterate
Of course this doesn't mean we shouldn`t add support for mobile, but why do we need to ruin the fun for PC players who want to make something special.
Add any other context or screenshots about the feature request here.
(once again) relevant PRs
#12264 user input mechanisms (for detecting touchpad) <---- most important, could be essential
#12367 window/screen size information (for better scaling)
(updated)
Problem
It's extremely frustrating to create a control scheme that allows the player to do a number of different things when we are limited to only a few keys for controls. There's an express need for an additional expansion to the PC and desktop control scheme and possibly mobile.
currently, we're limited to about 3 different keys (if you're generous) for non-movement (or other hard-coded action) controls. This is frustrating as if you want to make a special menu, a action key (like a special ability), or a movement key (like crouch, prone), this is very limiting, and especially considering shift and zoom already having an action. While you can be creative, this basically still limits you to one key for any given action, and since most servers use aux for sprint... you basically have nothing.
Solutions
See #12488 (comment)
Details
**PC/DESKTOP**I propose two possible solutions (for PC)
Solution A: allow games to take matters into their own hands.
Allow mods to see the control binds of players, and see (almost) all pressed keys
this would be used to get key binds, this is so mods can plan around existing player key binds, and even create their own binding system
minetest.get_player_key_binds(player) = {forward = "w", left = "a" . . . etc}this would be a list of active keys, if a key is active it should not be on the list. This list would exclude some keys, like windows button (and linux equivalent), the function keys, or anything else sensitive or not needed.
minetest.get_player_held_controls(player) = {w = true, a = true . . . etc}these functions could alternatively be methods for the player object.
Best/adopted solution (for PC)
Solution B: allow game/world key binds
This would allow games to create their own custom key bind settings for each player, and allow the client to interface with it.
on joining, the player would receive a list of key binds, this would be directly interfaceable with the "change keys" button, this should be modifiable by the server in post. The client would store these key binds by server in a human readable file format. This is especially important as to allow players to copy across versions etc, these files also should never delete themselves.
mostly self explanitory:
the world keybinds would function as a sort of default
minetest.set_world_keybinds({keyname="key" . . . etc})minetest.add_world_keybind(keyname, key)minetest.on_player_change_keybinds(function(player, key, value))(edit): a useful system to implement would also be the ability to send a request to get player keybinds...
this would allow the server to store the keybinds, and to replace current local keybinds for any reason (use case being if the client reinstalled, they wouldn't be screwed over.)
minetest.get_keybinds(playername)minetest.send_keybinds(binds, playername)--returns true if accepted/unsuccessful, else false.(during chat, or when a formspec is open, these would be ignored)
MOBILE
I propose one solution for mobile, this would be the addition of "buttons" to the HUD definition.
It's fairly simple actually:
the size of the button would be the same size as the image or text, just a box. The change would include this addition to the HUD definition:
button = function(player)button_image = "image.png""button" would be called while the player presses down on it, when it's being pressed down upon, the image would change to button_image (if present). HOWEVER this system would require atleast 1 other PR(s)/issues to be put in place:
see relevant PRs:
#12264 user input mechanisms (for detecting touchpad) <---- most important, could be essential
#12367 window/screen size information (for better scaling)
If the inclusion of PR 12264 can not be made, HUD images with the button function should not be displayed on devices without capabilities to use them.
additional
Mobile (could) be delayed for obvious reasons
The engine does not currently have the framework to allow for the support of mobile in regards to controls... but this doesn't mean we should limit ourselves and not make improvements where we can.
We should improve PC control inputs and settings, and upgrade mobile options later, it's silly to limit ourselves to "X platform can't do Y so we should leave out this entirely basic feature for Z until we rework the entire engine".
Besides, games/mods that require additional controls are likely to hard to play on mobile, though I agree that's not our choice to make- it's the truth, and ignoring it is a massive oversight.
to reiterate
Of course this doesn't mean we shouldn`t add support for mobile, but why do we need to ruin the fun for PC players who want to make something special.
Add any other context or screenshots about the feature request here.
(once again) relevant PRs
#12264 user input mechanisms (for detecting touchpad) <---- most important, could be essential
#12367 window/screen size information (for better scaling)