Difference between revisions of "Lua:keyUp"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''function''' keyUp(''key'') Sets the key to the up state ===Function Parameters=== {|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0" !align="left"|P…')
 
m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''function''' keyUp(''key'')
+
[[Category:Lua]]
 +
'''function''' keyUp(''Key'')
  
Sets the key to the up state
+
Causes the specified key to go into the "up" (released) state
 +
This simulates releasing a key that was previously pressed.
  
 
===Function Parameters===
 
===Function Parameters===
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 
!align="left"|Parameter
 
!align="left"|Parameter
 
!align="left"|Type
 
!align="left"|Type
 
!style="width: 80%;background-color:white;" align="left"|Description
 
!style="width: 80%;background-color:white;" align="left"|Description
 
|-
 
|-
|key
+
|Key
|[[Virtual-Key Code]]
+
|Integer or [[Virtual-Key Code]]
|The keycode for the key to set up
+
|The virtual key code of the key to release (e.g., <code>VK_F1</code>, <code>VK_SHIFT</code>).
 
|}
 
|}
  
 +
===Examples===
 +
<pre>
 +
-- Simulate releasing the left control key
 +
keyUp(VK_LCONTROL)
  
== See also ==
+
-- Simulate releasing the "A" key
* [[keyDown]]
+
keyUp(VK_A)
* [[Virtual-Key Code]]
+
</pre>
* [[Lua]]
+
 
 +
=== Related Functions ===
 +
* [[Lua:keyDown|keyDown]]

Latest revision as of 18:01, 11 July 2025

function keyUp(Key)

Causes the specified key to go into the "up" (released) state. This simulates releasing a key that was previously pressed.

Function Parameters[edit]

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

Examples[edit]

-- Simulate releasing the left control key
keyUp(VK_LCONTROL)

-- Simulate releasing the "A" key
keyUp(VK_A)

Related Functions[edit]