public static void DeactivateMouse() { // if (!mouse_avail || c == null) return; if (IN.mouse_active) { IN.uninstall_grabs(); IN.mouse_active = false; } }
public static void Frame() { if (!Globals.cl.cinematicpalette_active && (!Globals.cl.refresh_prepped || Globals.cls.key_dest == Defines.key_console || Globals.cls.key_dest == Defines.key_menu)) { IN.DeactivateMouse(); } else { IN.ActivateMouse(); } }
public static void toggleMouse() { if (IN.mouse_avail) { IN.mouse_avail = false; IN.DeactivateMouse(); } else { IN.mouse_avail = true; IN.ActivateMouse(); } }
public static void ActivateMouse() { if (!IN.mouse_avail) { return; } if (!IN.mouse_active) { KBD.mx = KBD.my = 0; // don't spazz IN.install_grabs(); IN.mouse_active = true; } }
public static void Real_IN_Init() { // mouse variables Globals.m_filter = Cvar.Get("m_filter", "0", 0); Globals.in_mouse = Cvar.Get("in_mouse", "1", Defines.CVAR_ARCHIVE); Globals.freelook = Cvar.Get("freelook", "1", 0); Globals.lookstrafe = Cvar.Get("lookstrafe", "0", 0); Globals.sensitivity = Cvar.Get("sensitivity", "3", 0); Globals.m_pitch = Cvar.Get("m_pitch", "0.022", 0); Globals.m_yaw = Cvar.Get("m_yaw", "0.022", 0); Globals.m_forward = Cvar.Get("m_forward", "1", 0); Globals.m_side = Cvar.Get("m_side", "0.8", 0); Cmd.AddCommand("+mlook", () => { IN.MLookDown(); }); Cmd.AddCommand("-mlook", () => { IN.MLookUp(); }); Cmd.AddCommand("force_centerview", () => { IN.Force_CenterView_f(); }); Cmd.AddCommand("togglemouse", () => { IN.toggleMouse(); }); IN.mouse_avail = true; }
private static void MLookUp() { IN.mlooking = false; IN.CenterView(); }