]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.c
csqc patch from [515], seems to work with [515]'s dpcsqc test mod, needs a lot of...
[xonotic/darkplaces.git] / keys.c
diff --git a/keys.c b/keys.c
index 7277a99f09cbd1cf5d9efa63739c2c1b4ebe9d56..97070dd684fac8a5b9eef7c112d398910f8241b6 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -820,6 +820,16 @@ Key_Init (void)
        Cmd_AddCommand ("unbindall", Key_Unbindall_f);
 }
 
+const char *Key_GetBind (int key)
+{
+       const char *bind;
+       bind = keybindings[key_bmap][key];
+       if (!bind)
+               bind = keybindings[key_bmap2][key];
+       return bind;
+}
+
+qboolean CL_VM_InputEvent (qboolean pressed, int key);
 
 /*
 ===================
@@ -831,12 +841,26 @@ void
 Key_Event (int key, char ascii, qboolean down)
 {
        const char *bind;
+       qboolean q;
 
        // get key binding
        bind = keybindings[key_bmap][key];
        if (!bind)
                bind = keybindings[key_bmap2][key];
 
+       if(key_dest == key_game)
+       {
+               q = CL_VM_InputEvent(!down, key);
+               if(q)
+               {
+                       if (down)
+                               keydown[key] = min(keydown[key] + 1, 2);
+                       else
+                               keydown[key] = 0;
+                       return;
+               }
+       }
+
        if (!down)
        {
                // clear repeat count now that the key is released