I want to unbind and rebind

I want to unbind and rebind

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

I want to unbind and rebind

Post by Forboding Angel »

I want to unbind fps mode from c, and bind capture to it. Now I know how to bind c to capture, but I have no idea how to unbind fps mode. Am I missing something simple?

If someone feels like saving me the time of figuring it out, by all means, post the 2 lines of code it should take, if not, please point me in the right direction. I have no idea what fps mode is called in the engine. Capture is just cmd_capture unless I'm mistaken...


Anyway, halp plox!
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: I want to unbind and rebind

Post by Beherith »

unbind Any+c controlunit
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I want to unbind and rebind

Post by knorke »

Spring.SendCommands ("unbind Any+c controlunit")
(or SendCommand)
notice no /
I looked at uikeys.txt in hope all possible commands would be listed but at least capture is not listed there. some others are though, so if you want to unbind more stuff like share dialog you could look there.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: I want to unbind and rebind

Post by Beherith »

Uikeys.txt contains only the default binds, so that you know what to unbind if you need something else there.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I want to unbind and rebind

Post by knorke »

Uikeys.txt contains only the default binds
complete list anywhere? did not find one so far.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I want to unbind and rebind

Post by Forboding Angel »

Keep in mind that I'm doing this in a gadget. For all intents and purposes uikeys does not exist in this instance.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I want to unbind and rebind

Post by knorke »

unsynched part of gadget...
but i meant uikeys.txt as reference/docu.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: I want to unbind and rebind

Post by zwzsg »

uikeys.txt mentions something about
/keysave : save current bindings to 'uikeys.tmp' (NOTE: 'tmp' vs. 'txt')
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I want to unbind and rebind

Post by Forboding Angel »

Code: Select all

	Spring.SendCommands({
		"unbindkeyset c",
	})
	Spring.SendCommands("bind c capture")
In case anyone is curious, ^^ that is how to do it.
Post Reply

Return to “Lua Scripts”