[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 » 08 Jan 2011, 17:38

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.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: How to bind the § key?

Post by Beherith » 08 Jan 2011, 17:44

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
0 x

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

Re: How to bind the § key?

Post by meriton » 08 Jan 2011, 17:53

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.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: How to bind the § key?

Post by Beherith » 08 Jan 2011, 18:19

That character does not seem to be in the ascii table. You might want to try switching input locales to english before game.
0 x

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

Re: How to bind the § key?

Post by meriton » 08 Jan 2011, 18:59

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).
0 x

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: How to bind the § key?

Post by aegis » 08 Jan 2011, 19:12

you could use something like autohotkey to bind § to ` outside of spring
0 x

User avatar
very_bad_soldier
Posts: 1371
Joined: 20 Feb 2007, 01:10

Re: How to bind the § key?

Post by very_bad_soldier » 08 Jan 2011, 20:34

Please try this in your uikeys.txt:

Code: Select all

bind Any+/ drawinmap
Not sure if it will work though.
0 x

trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: How to bind the § key?

Post by trepan » 08 Jan 2011, 21:30

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).
0 x

SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: How to bind the § key?

Post by SirMaverick » 08 Jan 2011, 22:21

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
0 x

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

Re: How to bind the § key?

Post by meriton » 09 Jan 2011, 03:58

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.
0 x

Post Reply

Return to “Help & Bugs”