Page 1 of 1

Disabling ~ for dev console

PostPosted: Thu Dec 05, 2013 11:09 am
by SM Sith Lord
I need to completely disable the ~ key from opening the developer's console during certain events in my game.

I'm having a little trouble finding where this should be done in the code. Does anybody have some suggestions?

Re: Disabling ~ for dev console

PostPosted: Thu Dec 05, 2013 11:30 pm
by LordDz
I'm a bit unsure why you would like to do that. But what I can think of is to unbind the console key during those moments.
And.. From what I know of, only American keyboards use the ~ for the console.

Re: Disabling ~ for dev console

PostPosted: Fri Dec 06, 2013 3:28 am
by Gary
They could probably get around it by exec a config and directly calling the command it's bound to.

Re: Disabling ~ for dev console

PostPosted: Fri Dec 06, 2013 10:40 am
by SM Sith Lord
Ah yes, I could find the bound key to the toggleconsole command, and unbind it, then rebind it after the menu is displayed. Awesome. Hopefully its not bound at a lower level, like the ESC key was.

LordDz, I need to do this to prevent the player from un-pausing the game before he makes a selection from my menu. I disabled ESC key, but the console command can un-pause the game as well.

Re: Disabling ~ for dev console

PostPosted: Fri Dec 06, 2013 11:00 am
by LordDz
But then comes the problem: What if your player has to exit the game right at the moment when he's in your selection menu?

Re: Disabling ~ for dev console

PostPosted: Fri Dec 06, 2013 4:06 pm
by SM Sith Lord
There are only 2 options on this menu: quit and resume. lol :P

Elaboration:
When you launch a game from the new version of SMAR•CADE, the entire screen goes grey and the words "PAUSED - Click to resume" appear on the screen, then I turn off the renderer and release all the resources. When the render is off, nothing gets updated, not even the main menu. Even though its not being rendered, the VGUI is still there. I have a big button that takes up 100% of the screen, so when you click anywhere on the screen, it turns the render back on and re-loads all the resources back in. Now it is ready to render and display the main menu again.

So there isn't actually a "Quit" button yet, but I need to think of a way to add one. If I'm closing a game because I want to shut down the whole computer, I would hate having to click RESUME just to get to a QUIT button. Maybe I'll change the words to say "Click to resume, ESC to exit". That should solve the problem of not being able to render anything. :D