Difference between revisions of "ScriptHook: Key Binds"

From Nomad DB
(Created page with "A Script can register Key bindings. == Registering a Key Bind == To register a Key bind, use WD2 ScriptHook: manifest.json. '''manifest.json''...")
 
Line 22: Line 22:
 
})
 
})
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== Related Pages ==
 +
* [[WD2 ScriptHook]]
 +
* [[WD2 ScriptHook: manifest.json]]
 +
 +
[[Category:WD2 ScriptHook]]

Revision as of 19:15, 14 April 2020

A Script can register Key bindings.

Registering a Key Bind

To register a Key bind, use WD2 ScriptHook: manifest.json.

manifest.json

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

Key Handler

Use ScriptHook.RegisterKeyHandler function.

Example

Registers a callback function to a Key binding.

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

Related Pages