Allow scrolling with mouse in console

Mouse keycodes have been added to consolekeys. Unbound key warnings now only print when in-game.
This commit is contained in:
Max Crofts 2019-06-04 19:36:37 +10:00
parent ebb6b9fce6
commit bc565030a5

View file

@ -1016,6 +1016,10 @@ Key_Init(void)
consolekeys[K_KP_PLUS] = true;
consolekeys[K_KP_MINUS] = true;
consolekeys[K_KP_5] = true;
consolekeys[K_MWHEELUP] = true;
consolekeys[K_MWHEELDOWN] = true;
consolekeys[K_MOUSE4] = true;
consolekeys[K_MOUSE5] = true;
consolekeys['`'] = false;
consolekeys['~'] = false;
@ -1160,7 +1164,8 @@ Key_Event(int key, qboolean down, qboolean special)
}
/* Key is unbound */
if ((key >= K_MOUSE1 && key != K_JOY_BACK) && !keybindings[key] && (cls.key_dest != key_console))
if ((key >= K_MOUSE1 && key != K_JOY_BACK) && !keybindings[key] && (cls.key_dest != key_console) &&
(cls.state == ca_active))
{
Com_Printf("%s is unbound, hit F4 to set.\n", Key_KeynumToString(key));
}