Xonotic Forums
[SUGGESTION] Different Input Key Settings for different Game Modes - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Suggestion Box (https://forums.xonotic.org/forumdisplay.php?fid=20)
+--- Thread: [SUGGESTION] Different Input Key Settings for different Game Modes (/showthread.php?tid=7263)



Different Input Key Settings for different Game Modes - Magician - 03-07-2017

Hello, i would like to have different input key settings for different game modes, eg when playing normal dm i have E bound to the crylink, but when playing instagib i have E bound to the hook. It would be nice to not have to manually change the Key settings everytime when switching game mode. ^^


RE: Different Input Key Settings for different Game Modes - -z- - 03-07-2017

Hello, I've worked on two resources to help in this regard. The first is the "keybind configurator" it's slightly broken, but still a useful way to visually modify your keybinds: https://z.github.io/kbx
The other is my config which supports what you're asking for, https://github.com/z/xonotic-config.pk3dir 
This is achieved with my "bind_swap" alias, excerpt below:
Code:
// Button Loaded Configs

alias bind_swap "exec binds-empty.cfg; exec config/binds-empty-ascii.cfg; exec config/binds-$new_bind_set.cfg; exec config/aliases/bind_swap.cfg; echo ^1[ ^4Loaded ^$new_bind_set_color$new_bind_set ^4Config ^1]; bf"

bind pgdn "set new_bind_set_color 5; set new_bind_set video; bind_swap"
bind pgup "set new_bind_set_color 6; set new_bind_set default; bind_swap"
bind end "set new_bind_set_color 7; set new_bind_set defrag; bind_swap"
bind home "set new_bind_set_color 3; set new_bind_set ctf; bind_swap"
What the above does, is 1) define a bind_swap alias that clears out old binds  2) executes the bind swap I want  3) displays a message to the user that the binds were swapped.