Inside3D!
     

CSQC Mouse Control

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Wed Apr 08, 2009 9:52 am    Post subject: CSQC Mouse Control Reply with quote

I'm confused about how to get a mouse on the screen in csqc. I only see 2 builtins that are probably used for such a task. I've said it before and I'll say it again! WE NEED MORE CSQC TUTORIALS Smile

vector () getmousepos = #344;
void (float f) setwantsmousemove = #343;
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Apr 08, 2009 10:12 am    Post subject: Reply with quote

Quote:

float(float event, float parama, float paramb) CSQC_InputEvent;
event is one of: 0:key pressed, 1:key released, 2:mouse move.
mouse movement is not yet notified. Call getmousepos to find where the cursor currently is.
This is called if setwantskeys was last called with the parameter true.
This func returns a value. "false" signalize that engine *should* take care of the keypress, a return value of true will make the engine otherwise ignore the event ever happened. This helps to use only keys that are really needed.
With keyboard events, parama is set to the keycode. The key values are as in the menu.dat (and DarkPlaces), and consistant between engines.
With mouse movement events, parama contains the X motion of the mouse, while paramb contains the Y motion of the mouse.


I'm not sure how sustainable that is.
Tbh I've no idea. My original docs don't describe any more.
If I were to design it now I'd probably make mouse events always go through InputEvent, and allow getmousepos only when explicitly enabled (thereby releasing the cursor in windowed mode, but leaving it invisible).
DP probably does it some other way.
I really can't remember how FTE works here: 'mouse movement is not yet notified' is likely still true, unfortunatly.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group