// CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
// Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
// All keys are in ascii.
-// bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
+// bInputType = 0 is key pressed, 1 is key released, 2 and 3 are mouse input.
// In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
// In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
+// In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos.
float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
{
float bSkipKey;
}
// do lockview after event chase camera so that it still applies whenever necessary.
- if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0) || intermission > 1)
+ if(autocvar_cl_lockview || intermission > 1)
{
setproperty(VF_ORIGIN, freeze_org);
setproperty(VF_ANGLES, freeze_ang);
string (float playernum, string key) getplayerkeyvalue = #348;
void (string cmdname) registercmd = #352;
+void(float usecursor) setcursormode = #343;
vector () getmousepos = #344;
string (string s) uncolorstring = #170;
HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha));
}
if (!hud_configure_prev)
+ {
+ setcursormode(1);
hudShiftState = 0;
+ }
}
+ else if (hud_configure_prev)
+ setcursormode(0);
hud_configure_prev = autocvar__hud_configure;
{
string s;
- // we only care for keyboard events
- if(bInputType != 0 && bInputType != 1)
+ if(bInputType == 2)
return false;
if(!autocvar__hud_configure)
if(autocvar__menu_alpha)
return true;
+ if(bInputType == 3)
+ {
+ mousepos_x = nPrimary;
+ mousepos_y = nSecondary;
+ return true;
+ }
+
// allow console bind to work
string con_keys;
float keys;
if(autocvar__menu_alpha == 1)
return;
- mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
- mousepos_x = bound(0, mousepos_x, vid_conwidth);
- mousepos_y = bound(0, mousepos_y, vid_conheight);
-
if(mouseClicked)
{
if(prevMouseClicked == 0)