How to disable certain controls?

Grab your favourite IDE and tinker with the innards of game engines

How to disable certain controls?

Postby jmoak3 on Thu Feb 13, 2014 6:54 pm

I'm trying to disable zooming and quicksaving/quickloading on the part of the player.
This means that the console command "+zoom" should still work.

I've been searching for about a week, just sifting through the code looking for a way to do this.

I recently had the idea to check if the player was pressing the button himself using (m_afButtonPressed & IN_ZOOM) in the function that starts the zooming (called when the command for zoom is present in the game's systems).

Sadly when +zoom is typed in the console, for some reason (m_afButtonPressed & IN_ZOOM) still returns true, and the zooming does an early out.

I've also been trying to find where the default keys are bound, where I could remove the zoom key as 'z' from the default list and then later go into the keyboard bindings in the options menu and remove that as an option somehow.
I can't seem to find for the life of me where it contains these defaults. I mean if you delete config.cfg or config_default.cfg it generates a new one of default values, so where do those come from and how do I remove them?

Thanks in advance!
Joined: Wed Jan 22, 2014 11:24 pm

Return to Programming

Who is online

Users browsing this forum: Google [Bot]