Lua:keyDown

From Cheat Engine
Revision as of 20:16, 25 June 2026 by Leunsel (talk | contribs) (Syntax Highlighting.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> Lua API Reference

function keyDown(Key)

Causes the specified key to go into the "down" (pressed) state. This simulates pressing and holding the key.

Function Parameters

Parameter Type Description
Key Integer or Virtual-Key Code The virtual key code of the key to press down (e.g., VK_F1, VK_SHIFT).

Examples

1 -- Simulate pressing and holding the left control key
2 keyDown(VK_LCONTROL)
3 
4 -- Simulate pressing and holding the "A" key
5 keyDown(VK_A)

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Mouse Related Functions

Keyboard Related Functions

Global Hotkey Related Functions