Keybind codes?

For all the help you need with Armagetron!
Post Reply
Durf
Match Winner
Posts: 426
Joined: Mon Jul 30, 2012 10:35 pm

Keybind codes?

Post by Durf »

I was taking a look at a user.cfg the other day:

Code: Select all

KEYBOARD 333	PLAYER_BIND	ZOOM_OUT	1
KEYBOARD	332	PLAYER_BIND	ZOOM_IN	1
KEYBOARD	327	PLAYER_BIND	BANK_DOWN	1
...
...
...
KEYBOARD	19	PLAYER_BIND	PAUSE_GAME	0
KEYBOARD	9	PLAYER_BIND	SCORE	0
KEYBOARD	8	PLAYER_BIND	INSTANT_CHAT_25	1
I believe that section is the default controls.
But I don't understand where these other numbers are coming from.
The last one, for instant chat 25, I know is for backspace (KEYBOARD 8 ).

Is there somewhere I can get a complete reference of these numbers to keys? (for all keys)
/me doesn't code in c++ :[
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Keybind codes?

Post by Z-Man »

They're SDL Keysyms, documented here: http://www.libsdl.org/docs/html/sdlkey.html
The actual numeric value can change and are in /usr/include/SDL/SDL_keysym.h if you're running Linux and have the SDL development package installed. I know of no other place. For 0.4, we switched to the keysym names to make things less cryptic.
Durf
Match Winner
Posts: 426
Joined: Mon Jul 30, 2012 10:35 pm

Re: Keybind codes?

Post by Durf »

ummm, ok.
So I still don't have a clue what you're talking about.

This is not for a c++ project of any kind; I'm making a webpage tool that can save alternate user options in a cfg file.
To add controls to this tool, I just need the list of what those numbers mean(which key they refer to).
I need these numbers to actually make the controls in the CFG file that the user will include(in game).

As for 0.4, I had no idea it was different and I guess I'll have to look into that later.
Also I don't have that SDL package installed.
If I were to install it, would the default SDL keysyms be the same as the ones that Armagetron uses in its user.cfg files?
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Keybind codes?

Post by Z-Man »

Not to complicate matters with explanations:
Durf wrote:If I were to install it, would the default SDL keysyms be the same as the ones that Armagetron uses in its user.cfg files?
Yes.
Durf
Match Winner
Posts: 426
Joined: Mon Jul 30, 2012 10:35 pm

Re: Keybind codes?

Post by Durf »

Thanks!
Exactly what I needed.
Post Reply