mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-18 23:21:37 +00:00
* Shift no longer modifies bound keys. Use in_shiftedKeys for the old
behaviour.
This commit is contained in:
parent
f63472025f
commit
d9cb8cb083
2 changed files with 40 additions and 23 deletions
1
README
1
README
|
@ -117,6 +117,7 @@ New cvars
|
||||||
r_GLlibCoolDownMsec - wait for some milliseconds to close GL library
|
r_GLlibCoolDownMsec - wait for some milliseconds to close GL library
|
||||||
com_altivec - enable use of altivec on PowerPC systems
|
com_altivec - enable use of altivec on PowerPC systems
|
||||||
s_backend - read only, indicates the current sound backend
|
s_backend - read only, indicates the current sound backend
|
||||||
|
in_shiftedKeys - non-SDL Linux only. Enables binding to shifted keys
|
||||||
cl_consoleHistory - read only, stores the console history
|
cl_consoleHistory - read only, stores the console history
|
||||||
cl_platformSensitivity - read only, indicates the mouse input scaling
|
cl_platformSensitivity - read only, indicates the mouse input scaling
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,7 @@ static int mouseResetTime = 0;
|
||||||
|
|
||||||
static cvar_t *in_mouse;
|
static cvar_t *in_mouse;
|
||||||
static cvar_t *in_dgamouse; // user pref for dga mouse
|
static cvar_t *in_dgamouse; // user pref for dga mouse
|
||||||
|
static cvar_t *in_shiftedKeys; // obey modifiers for certain keys in non-console (comma, numbers, etc)
|
||||||
cvar_t *in_subframe;
|
cvar_t *in_subframe;
|
||||||
cvar_t *in_nograb; // this is strictly for developers
|
cvar_t *in_nograb; // this is strictly for developers
|
||||||
|
|
||||||
|
@ -199,6 +200,7 @@ static const char *Q_stristr( const char *s, const char *find)
|
||||||
static char *XLateKey(XKeyEvent *ev, int *key)
|
static char *XLateKey(XKeyEvent *ev, int *key)
|
||||||
{
|
{
|
||||||
static char buf[64];
|
static char buf[64];
|
||||||
|
static char bufnomod[2];
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
int XLookupRet;
|
int XLookupRet;
|
||||||
|
|
||||||
|
@ -209,6 +211,15 @@ static char *XLateKey(XKeyEvent *ev, int *key)
|
||||||
ri.Printf(PRINT_ALL, "XLookupString ret: %d buf: %s keysym: %x\n", XLookupRet, buf, keysym);
|
ri.Printf(PRINT_ALL, "XLookupString ret: %d buf: %s keysym: %x\n", XLookupRet, buf, keysym);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!in_shiftedKeys->integer) {
|
||||||
|
// also get a buffer without modifiers held
|
||||||
|
ev->state = 0;
|
||||||
|
XLookupRet = XLookupString(ev, bufnomod, sizeof bufnomod, &keysym, 0);
|
||||||
|
#ifdef KBD_DBG
|
||||||
|
ri.Printf(PRINT_ALL, "XLookupString (minus modifiers) ret: %d buf: %s keysym: %x\n", XLookupRet, buf, keysym);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
switch (keysym)
|
switch (keysym)
|
||||||
{
|
{
|
||||||
case XK_KP_Page_Up:
|
case XK_KP_Page_Up:
|
||||||
|
@ -341,6 +352,7 @@ static char *XLateKey(XKeyEvent *ev, int *key)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// XK_* tests failed, but XLookupString got a buffer, so let's try it
|
// XK_* tests failed, but XLookupString got a buffer, so let's try it
|
||||||
|
if (in_shiftedKeys->integer) {
|
||||||
*key = *(unsigned char *)buf;
|
*key = *(unsigned char *)buf;
|
||||||
if (*key >= 'A' && *key <= 'Z')
|
if (*key >= 'A' && *key <= 'Z')
|
||||||
*key = *key - 'A' + 'a';
|
*key = *key - 'A' + 'a';
|
||||||
|
@ -348,6 +360,9 @@ static char *XLateKey(XKeyEvent *ev, int *key)
|
||||||
// see https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=19
|
// see https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=19
|
||||||
else if (*key >= 1 && *key <= 26)
|
else if (*key >= 1 && *key <= 26)
|
||||||
*key = *key + 'a' - 1;
|
*key = *key + 'a' - 1;
|
||||||
|
} else {
|
||||||
|
*key = bufnomod[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1734,6 +1749,7 @@ void IN_Init(void) {
|
||||||
// mouse variables
|
// mouse variables
|
||||||
in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
|
in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
|
||||||
in_dgamouse = Cvar_Get ("in_dgamouse", "1", CVAR_ARCHIVE);
|
in_dgamouse = Cvar_Get ("in_dgamouse", "1", CVAR_ARCHIVE);
|
||||||
|
in_shiftedKeys = Cvar_Get ("in_shiftedKeys", "0", CVAR_ARCHIVE);
|
||||||
|
|
||||||
// turn on-off sub-frame timing of X events
|
// turn on-off sub-frame timing of X events
|
||||||
in_subframe = Cvar_Get ("in_subframe", "1", CVAR_ARCHIVE);
|
in_subframe = Cvar_Get ("in_subframe", "1", CVAR_ARCHIVE);
|
||||||
|
|
Loading…
Reference in a new issue