Question: How to disable Input in CSQC?

Discuss programming in the QuakeC language.
Post Reply
Mexicouger
Posts: 514
Joined: Sat May 01, 2010 10:12 pm
Contact:

Question: How to disable Input in CSQC?

Post by Mexicouger »

Hello everyone, I'm making a menu in CSQC, and I am wondering as to how I can either disable game input, or revert all input to work with the menu.
Any help would be appreciated.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Question: How to disable Input in CSQC?

Post by Spike »

if CSQC_InputEvent returns true, the engine will not handle the input event.
basically, if you've got some menu grabbing keypresses, just return true, otherwise return false.
you should probably always return false for keyup events though.

CSIE_KEYDOWN = 0, /*syscode, unicode, devid*/
CSIE_KEYUP = 1, /*syscode, unicode, devid*/
CSIE_MOUSEDELTA = 2, /*x, y, devid*/
CSIE_MOUSEABS = 3, /*x, y, devid*/

whether you get delta or absolute mouse events depends upon the engine, the input methods, etc.
a mouse will generally be delta events, but if you've got a touchscreen or the mouse is not grabbed and the engine is running windowed then you'll get absolute events.
the names in the comments are the 2nd, 3rd, and 4th arguments to CSQC_InputEvent for the specified event.
note that devid argument allows you to distinguish between multiple mice, or multi-touch events.

So yeah, return true to keydown events and the engine binds will be blocked, but return true to keyup events and the -forward etc released commands will never be generated.
Mexicouger
Posts: 514
Joined: Sat May 01, 2010 10:12 pm
Contact:

Re: Question: How to disable Input in CSQC?

Post by Mexicouger »

Hey thanks Spike, I got it working with your help. It was something so simple too :P
Post Reply