Custom keybindings for custom code

leeminer
Member
 
Posts: 90
Joined: Mon Aug 11, 2014 21:29

Custom keybindings for custom code

by leeminer » Sat Dec 20, 2014 12:13

I think Wuzzy brought this up in another thread, but here goes. I want to add new keys that when pressed execute code or chat commands that I setup.

For example, in the mod I am developing, I want two keys to change the jump height. One to increase it and one to decrease it.

Is this even possible? This would be really cool, not just for my mod but for any mod or game attempted with Minetest.
 

User avatar
rubenwardy
Moderator
 
Posts: 5965
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Custom keybindings for custom code

by rubenwardy » Sat Dec 20, 2014 12:17

You could edit the core code of Minetest to add this, but it wouldn't be very flexible. (ie: in the game class, look for a key press, if it is pressed then run a chat command).

Function keys would be nice - the user defines which chat commands are run when a key is pressed.
 

User avatar
philipbenr
Member
 
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

Re: Custom keybindings for custom code

by philipbenr » Sat Dec 20, 2014 23:07

That was put in the Wishes for 0.4.11 or 0.5 thread. I think the devs get the picture that this is really wanted. However, this brings up a problem. Too many people would use this and eventually the entire keyboard would be filled from all the cool mods (very unlikely but still...). I think using chat commands will be the best, instead of single keys, because there are infinitely more combos than with single keys.
 

User avatar
rubenwardy
Moderator
 
Posts: 5965
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Custom keybindings for custom code

by rubenwardy » Sun Dec 21, 2014 13:54

It should be a client side thing, not a mod thing. (what chat command or action a key does is set on the client side.)
 

User avatar
Inocudom
Member
 
Posts: 3080
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: Custom keybindings for custom code

by Inocudom » Sun Dec 21, 2014 18:06

I myself use a tablet, so it would be helpful if the functions of the mouse's buttons could be changed/moved.
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Custom keybindings for custom code

by Don » Sun Dec 21, 2014 18:20

I agree with philipbenr. The chances of key binding conflicts would be an issue. This could become a mess. If nothing stops me from using the same key binding as you then the end user will suffer.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
rubenwardy
Moderator
 
Posts: 5965
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Custom keybindings for custom code

by rubenwardy » Mon Dec 22, 2014 19:43

Don wrote:I agree with philipbenr. The chances of key binding conflicts would be an issue. This could become a mess. If nothing stops me from using the same key binding as you then the end user will suffer.


Please read my suggestion.
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Custom keybindings for custom code

by Don » Mon Dec 22, 2014 20:06

rubenwardy wrote:
Don wrote:I agree with philipbenr. The chances of key binding conflicts would be an issue. This could become a mess. If nothing stops me from using the same key binding as you then the end user will suffer.


Please read my suggestion.

Sorry. I agree with you too.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests