Lua:isKeyPressed

From Cheat Engine
Revision as of 17:58, 11 July 2025 by Leunsel (talk | contribs)
Jump to navigation Jump to search

function isKeyPressed(Key) : Boolean

Returns true if the specified key is currently pressed.

Function Parameters

Parameter Type Description
Key Integer or Virtual Key Codes The virtual key code of the key to check (e.g., VK_F1, VK_SHIFT).

Returns

Boolean — true if the key is pressed, false otherwise.

Examples

if isKeyPressed(VK_SPACE) then
  print("Spacebar is currently pressed!")
end

if isKeyPressed(VK_LSHIFT) then
  print("Left Shift is pressed")
end

See also