mirror of https://bitbucket.org/CPMADevs/cnq3
implemented in_noGrab on Windows
This commit is contained in:
parent
27afb67ed1
commit
6238d7dd7f
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
DD Mmm 17 - 1.49
|
DD Mmm 17 - 1.49
|
||||||
|
|
||||||
|
add: in_noGrab <0|1> (default: 0) disables input grabbing
|
||||||
|
|
||||||
add: bindkeylist command to print all bindable key names
|
add: bindkeylist command to print all bindable key names
|
||||||
|
|
||||||
add: uptime command that prints uptimes for the process, the current map and the parent process
|
add: uptime command that prints uptimes for the process, the current map and the parent process
|
||||||
|
@ -146,8 +148,6 @@ Linux:
|
||||||
chg: the client requires SDL 2 - the following things are handled by it:
|
chg: the client requires SDL 2 - the following things are handled by it:
|
||||||
window, GL context, video modes, audio, kb and mouse input, monitor list, clipboard
|
window, GL context, video modes, audio, kb and mouse input, monitor list, clipboard
|
||||||
|
|
||||||
add: in_noGrab <0|1> (default: 0) disables input grabbing
|
|
||||||
|
|
||||||
add: m_relative <0|1> (default: 1) enables SDL's relative mouse mode
|
add: m_relative <0|1> (default: 1) enables SDL's relative mouse mode
|
||||||
you might want to set it to 0 if you have a messed up input driver
|
you might want to set it to 0 if you have a messed up input driver
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ static cvar_t* m_relative;
|
||||||
static cvar_t* s_autoMute;
|
static cvar_t* s_autoMute;
|
||||||
|
|
||||||
static const cvarTableItem_t in_cvars[] = {
|
static const cvarTableItem_t in_cvars[] = {
|
||||||
{ &in_noGrab, "in_noGrab", "0", CVAR_ARCHIVE, CVART_BOOL, NULL, NULL, "disables input grabbing" },
|
{ &in_noGrab, "in_noGrab", "0", 0, CVART_BOOL, NULL, NULL, "disables input grabbing" },
|
||||||
{ &m_relative, "m_relative", "1", CVAR_ARCHIVE, CVART_BOOL, NULL, NULL, "enables SDL's relative mouse mode" },
|
{ &m_relative, "m_relative", "1", CVAR_ARCHIVE, CVART_BOOL, NULL, NULL, "enables SDL's relative mouse mode" },
|
||||||
{ &s_autoMute, "s_autoMute", "1", CVAR_ARCHIVE, CVART_INTEGER, "0", "2", "0=never, 1=when unfocused, 2=when minimized" }
|
{ &s_autoMute, "s_autoMute", "1", CVAR_ARCHIVE, CVART_INTEGER, "0", "2", "0=never, 1=when unfocused, 2=when minimized" }
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,6 +25,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#include "win_help.h"
|
#include "win_help.h"
|
||||||
|
|
||||||
|
|
||||||
|
static cvar_t* in_noGrab;
|
||||||
|
|
||||||
|
|
||||||
struct Mouse {
|
struct Mouse {
|
||||||
Mouse() : active(qfalse), wheel(0) {}
|
Mouse() : active(qfalse), wheel(0) {}
|
||||||
|
|
||||||
|
@ -279,6 +282,10 @@ static void IN_StartupMouse()
|
||||||
Cvar_SetHelp( "in_mouse", help_in_mouse );
|
Cvar_SetHelp( "in_mouse", help_in_mouse );
|
||||||
in_mouse->modified = qfalse;
|
in_mouse->modified = qfalse;
|
||||||
|
|
||||||
|
in_noGrab = Cvar_Get( "in_noGrab", "0", 0 );
|
||||||
|
Cvar_SetRange( "in_noGrab", CVART_BOOL, NULL, NULL );
|
||||||
|
Cvar_SetHelp( "in_noGrab", "disables input grabbing" );
|
||||||
|
|
||||||
if (!in_mouse->integer) {
|
if (!in_mouse->integer) {
|
||||||
Com_Printf( "Mouse not active.\n" );
|
Com_Printf( "Mouse not active.\n" );
|
||||||
return;
|
return;
|
||||||
|
@ -413,6 +420,9 @@ void IN_Activate( qbool active )
|
||||||
|
|
||||||
static qbool IN_ShouldBeActive()
|
static qbool IN_ShouldBeActive()
|
||||||
{
|
{
|
||||||
|
if ( in_noGrab && in_noGrab->integer )
|
||||||
|
return qfalse;
|
||||||
|
|
||||||
return g_wv.activeApp && (!(cls.keyCatchers & KEYCATCH_CONSOLE) || Cvar_VariableIntegerValue("r_fullscreen"));
|
return g_wv.activeApp && (!(cls.keyCatchers & KEYCATCH_CONSOLE) || Cvar_VariableIntegerValue("r_fullscreen"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue