1

Topic: [HELP] How to bind escape key

I'm working on a new Linux image for the computers in our breakroom at work.  I included teeworlds in the new setup and wrote a custom startup script that freezes the configs and automatically connects players to our local server so they can play against each other.  The only problem is I can't find a way to disable the escape key.  I've ran
bind escape "quit"
and didn't get any errors but that didn't do anything.  For right now I just bound quit to F12 but it would make us all feel a lot better if we could disable the escape key.

2

Re: [HELP] How to bind escape key

Disable the escape key... it's used in many things like rendering the ingame menus and quitting the game in the Teeworlds code.
If you bound something to the Escape key you still can do : unbind escape.

What do you want exactly to do ?

Not Luck, Just Magic.

3

Re: [HELP] How to bind escape key

I want to disable the in game menus so users can't change any settings or connect to external servers.  So would disabling this require editing the source code?

4 (edited by Lanta 2010-06-16 15:19:13)

Re: [HELP] How to bind escape key

RedWagon wrote:

I want to disable the in game menus so users can't change any settings or connect to external servers.  So would disabling this require editing the source code?

Ehm, yes, seems not too hard.
Btw nice idea to make your worker play teeworlds @ work big_smile

Support Staff - ESL.eu Teeworlds Admin

5

Re: [HELP] How to bind escape key

I have the source code and am usually pretty good at reverse engineering stuff but there's just so much here.  Is there a developer that can give me some hints as to where I should be looking?

6 (edited by Lanta 2010-06-16 16:30:23)

Re: [HELP] How to bind escape key

/game/client/gameclient.cpp

// build the input stack
    input.add(&menus->binder); // this will take over all input when we want to bind a key
    input.add(&binds->special_binds);
    input.add(console);
    input.add(chat); // chat has higher prio due to tha you can quit it by pressing esc
    input.add(motd); // for pressing esc to remove it
    input.add(menus);
    input.add(&emoticon);
    input.add(controls);
    input.add(binds);

Just remove what u want. I've not tested (it's just an idea found on the fly), but it must work. Maybe later I'll try to see better big_smile

Support Staff - ESL.eu Teeworlds Admin

7

Re: [HELP] How to bind escape key

I guess that's hard to find all the possible ways to change its settings. You have to disable UI, console, and... also loading the settings.cfg.
Won't the players be able to change their names ? Won't they be able to join red / blue or spec ?
That's not as simple as you think... need more details.

Not Luck, Just Magic.

8 (edited by buffer[] 2010-06-17 07:57:37)

Re: [HELP] How to bind escape key

I'd say the simpliest way is to check outgoing packets's destination IP, and send only local ones.
That way they won't be able in the menu to connect to online servers, and to ask master servers for IPs.
Moreover, they'll be able to change names, mouse sens or personal stuff to enjoy the game (you said you made a script to restore default settings, so I don't see how bad could it be if they personalize them for their session) big_smile

PS: I'll post it if you that's what you want.

|ZPote| buffer[]'s posterous

9

Re: [HELP] How to bind escape key

Removing the list of the master-servers (masters.cfg) might be another possibility.

void ..

10

Re: [HELP] How to bind escape key

If someone can make me a Tutorial how too do this, (here) i would be glad so i can include it in the Binds tutorial.

Account inactive since 11/8
.. Although i sometimes visit :3...

11 (edited by Lanta 2010-06-17 21:34:14)

Re: [HELP] How to bind escape key

Alpha-Nuva wrote:

If someone can make me a Tutorial how too do this, (here) i would be glad so i can include it in the Binds tutorial.

There is no way to do this using bind. Your tutorial will cry now :'(
If you wanna add, you can bind the quit command to every key just doing
bind key "quit"
but it's obvious.

Support Staff - ESL.eu Teeworlds Admin

12 (edited by SephN6 2010-06-17 21:59:12)

Re: [HELP] How to bind escape key

Lanta wrote:
Alpha-Nuva wrote:

If someone can make me a Tutorial how too do this, (here) i would be glad so i can include it in the Binds tutorial.

There is no way to do this using bind. Your tutorial will cry now :'(
If you wanna add, you can bind the quit command to every key just doing
bind key "quit"
but it's obvious.

Pah, No idea, mic already made one ._.

Account inactive since 11/8
.. Although i sometimes visit :3...

13

Re: [HELP] How to bind escape key

Blue wrote:

Removing the list of the master-servers (masters.cfg) might be another possibility.

As long as people don't know any server IP. Otherwise they can simply direct-connect.

|ZPote| buffer[]'s posterous

14 (edited by Dune 2010-06-18 09:45:18)

Re: [HELP] How to bind escape key

Blue wrote:

Removing the list of the master-servers (masters.cfg) might be another possibility.

Removing the Internet might be another possibility.

Seriously, if you make a modded client for that, delete the IP textarea on the bottom.

Not Luck, Just Magic.