Difference between revisions of "Lua:setGlobalKeyPollInterval"

From Cheat Engine
Jump to navigation Jump to search
(Created page with "Category:Lua {{CodeBox|'''function''' setGlobalKeyPollInterval(''interval'') ''':''' void}} Sets the global key poll interval. The interval determines how often Cheat En...")
 
m (Syntax Highlighting.)
Line 21: Line 21:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
-- Check for key presses more frequently
 
-- Check for key presses more frequently
 
setGlobalKeyPollInterval(10)
 
setGlobalKeyPollInterval(10)
Line 27: Line 27:
 
-- Use a higher interval to reduce CPU usage
 
-- Use a higher interval to reduce CPU usage
 
setGlobalKeyPollInterval(100)
 
setGlobalKeyPollInterval(100)
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Revision as of 20:17, 25 June 2026

<> Lua API Reference

function setGlobalKeyPollInterval(interval) : void

Sets the global key poll interval.

The interval determines how often Cheat Engine checks whether a key has been pressed. Lower values are more accurate and responsive, but use more CPU power.

Function Parameters

Parameter Type Description
interval Integer The global key poll interval. Lower values check for key presses more often, but use more CPU power.

Returns

void — This function does not return any value.

Examples

1 -- Check for key presses more frequently
2 setGlobalKeyPollInterval(10)
3 
4 -- Use a higher interval to reduce CPU usage
5 setGlobalKeyPollInterval(100)

Main Pages

Core Lua documentation entry points

Lua
Script Engine