ScriptHook: Key Binds

From Nomad DB
Revision as of 11:29, 6 October 2020 by Administrator (talk | contribs) (→‎Related Pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A Script can register Key bindings.

Registering a Key Bind

To register a Key bind, use the Script's manifest.json.


"keyBinds": {
	"test": "F5"

List of Key Codes

Key Handler

Use ScriptHook.RegisterKeyHandler function.


Registers a callback function to a Key binding. In combination with the manifest.json above, this code would print "Key Bind" to the Console when pressing F5.

ScriptHook.RegisterKeyHandler("test", function()
	print("Key Bind")

Related Pages