diff --git a/src/lua_hook.h b/src/lua_hook.h
index e3af951f5fd15444a8d3907b3dfb5f750ec95b4a..223b83c61f7d9c35a451a3ea217344a341fe7126 100644
--- a/src/lua_hook.h
+++ b/src/lua_hook.h
@@ -107,6 +107,7 @@ void LUA_HookInt(INT32 integer, int hook);
 void LUA_HookBool(boolean value, int hook);
 int  LUA_HookPlayer(player_t *, int hook);
 int  LUA_HookTiccmd(player_t *, ticcmd_t *, int hook);
+int  LUA_HookKey(INT32 keycode, int hook); // Hooks for key events
 
 void LUA_HookThinkFrame(void);
 int  LUA_HookMobjLineCollide(mobj_t *, line_t *);
@@ -130,4 +131,3 @@ int  LUA_HookPlayerCmd(player_t *, ticcmd_t *);
 int  LUA_HookMusicChange(const char *oldname, struct MusicChange *);
 fixed_t LUA_HookPlayerHeight(player_t *player);
 int  LUA_HookPlayerCanEnterSpinGaps(player_t *player);
-int  LUA_HookKey(INT32 keycode, int hooktype); // Hooks for key events
diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c
index 39aa5ea18048dc74f96caadd7bdc828b79b0327c..6c709bf48e2660a3fbf5ee3178c35caebcf358be 100644
--- a/src/lua_hooklib.c
+++ b/src/lua_hooklib.c
@@ -588,6 +588,17 @@ int LUA_HookTiccmd(player_t *player, ticcmd_t *cmd, int hook_type)
 	return hook.status;
 }
 
+int LUA_HookKey(INT32 keycode, int hook_type)
+{
+	Hook_State hook;
+	if (prepare_hook(&hook, false, hook_type))
+	{
+		lua_pushinteger(gL, keycode);
+		call_hooks(&hook, 1, 0, res_true);
+	}
+	return hook.status;
+}
+
 /* =========================================================================
                                SPECIALIZED HOOKS
    ========================================================================= */
@@ -1088,14 +1099,3 @@ int LUA_HookPlayerCanEnterSpinGaps(player_t *player)
 	}
 	return hook.status;
 }
-
-int LUA_HookKey(INT32 keycode, int hooktype)
-{
-	Hook_State hook;
-	if (prepare_hook(&hook, 0, hooktype))
-	{
-		lua_pushinteger(gL, keycode);
-		call_hooks(&hook, 1, 0, res_true);
-	}
-	return hook.status;
-}