From d3f25170899acd3b44e343cdd07050b7d45edc67 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 24 Aug 2008 10:07:57 +0000 Subject: [PATCH] handle F key binds correctly (up event shall not go to CSQC) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8469 d7cf8633-e32d-0410-b094-e92efae38249 --- keys.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/keys.c b/keys.c index 3b0ea761..59f1a745 100644 --- a/keys.c +++ b/keys.c @@ -1018,21 +1018,25 @@ Key_Event (int key, char ascii, qboolean down) // send function keydowns to interpreter no matter what mode is (unless the menu has specifically grabbed the keyboard, for rebinding keys) if (keydest != key_menu_grabbed) - if (key >= K_F1 && key <= K_F12 && down) + if (key >= K_F1 && key <= K_F12) { // ignore key repeats on F1-F12 binds if (keydown[key] > 1) return; if (bind) { - // button commands add keynum as a parm - if (bind[0] == '+') - Cbuf_AddText (va("%s %i\n", bind, key)); - else + if(keydown[key] == 1 && down) { - Cbuf_AddText (bind); - Cbuf_AddText ("\n"); - } + // button commands add keynum as a parm + if (bind[0] == '+') + Cbuf_AddText (va("%s %i\n", bind, key)); + else + { + Cbuf_AddText (bind); + Cbuf_AddText ("\n"); + } + } else if(bind[0] == '+' && !down && keydown[key] == 0) + Cbuf_AddText(va("-%s %i\n", bind + 1, key)); } return; } -- 2.39.2