[Solved] How to bind the § key?

[Solved] How to bind the § key?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

[Solved] How to bind the § key?

Post by meriton »

I have a keyboad in locale de-ch, where the key left of 1 is labeled §. I am trying to bind it to the drawinmap command, so far without success.

So far, I tried:
1. In springsettings.exe -> hotkeys tab -> commands -> general :click on drawinmap
2. click into "New Shortcut", press the § key -> § appears
3. click add, save config

uikeys.txt then contains:

Code: Select all

bind		5		drawinmap
This doesn't seem right, because it tries to rebind the 5 key rather than §. Indeed, when I press § in game, nothing happens.

I also tried to manually edit uikeys.txt with

Code: Select all

bind		§		drawinmap
Still, nothing happens when I press § in game.
Last edited by meriton on 09 Jan 2011, 04:02, edited 1 time in total.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: How to bind the § key?

Post by Beherith »

First you have to unbind the originals, like so:

Code: Select all

unbind              Any+`  drawinmap
unbind              Any+\  drawinmap
unbind           Any+0xa7  drawinmap
Then

Code: Select all

bind Any+§ drawinmap
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: How to bind the § key?

Post by meriton »

That didn't work either (nothing happens when I press the key in game). I suspect it's because spring doesn't know what keycode the character § corresponds to. Unfortunately, neither do I.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: How to bind the § key?

Post by Beherith »

That character does not seem to be in the ascii table. You might want to try switching input locales to english before game.
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: How to bind the § key?

Post by meriton »

That's cumbersome in windows as far as I can tell. I don't want to change the system default, and switching it for an application requires me to see the task bar (bye bye fullscreen mode), or press a keyboard shortcut (Alt-Shift or Ctrl-Shift) I frequently use for other stuff and have therefore disabled.

It would therefore be helpful though if Spring supported binding non-ascii keys as well.

I think I'll stick to the default keymapping then (where the ä key is bound to drawinmap).
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: How to bind the § key?

Post by aegis »

you could use something like autohotkey to bind § to ` outside of spring
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: How to bind the § key?

Post by very_bad_soldier »

Please try this in your uikeys.txt:

Code: Select all

bind Any+/ drawinmap
Not sure if it will work though.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: How to bind the § key?

Post by trepan »

excerpt from uikeys.txt:

Code: Select all

//
//  Extra Run-Time Commands
//
//    /keyload   : loads the uikeys.txt bindings  (does not clear current bindings)
//    /keyreload : loads the uikeys.txt bindings  (clears current bindings first)
//    /keysave   : save current bindings to 'uikeys.tmp'  (NOTE: 'tmp' vs. 'txt')
//    /keysyms   : prints the known keysyms to standard out
//    /keycodes  : prints the known keycodes to standard out
//    /keyprint  : prints the current bindings to standard out
//    /keydebug  : prints debugging information to standard out (for each keystroke)
//
That last command may be of interest
(assuming that spring's code still supports it).
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: How to bind the § key?

Post by SirMaverick »

It does.

Use /keydebug to see what key spring is seeing when you press a button.
e.g.:
known key:
GetAction: enter (0x00D)
unknown key:
GetAction: 0x138 (0x138)

As explained in uikeys.txt you can define new keys and add commands as usual.
keysym SomeNameForYourKey 0x138
bind SomeNameForYourKey drawinmap
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: How to bind the § key?

Post by meriton »

Thanks a lot Trepan and SirMaverik, that worked like a charm. BTW, I had to use a pure ASCII symbolic key name (with § as symbolic name, the key was not bound).

This thread is now linked from the wiki page on keyboard bindings.

PS: It's still weird that springsettings.exe would write an incorrect entry into uikeys.txt, though.
Post Reply

Return to “Help & Bugs”