Event: Script:OnInputKey

From Nomad DB

This event is called everytime a Key is either pressed down or up.

This event is only available in Legion ScriptHook version 1.1 and later.

Usage

function script:OnInputKey(keyId, keyName, isDown)
	if isDown then
		print("Key " .. keyName .. " is down")
	else
		print("Key " .. keyName .. " is up")
	end
end

Preventing Input

Optionally, you can return false to indicate that a certain key should not be processed by the game. The following example prevents the "W" key.

function script:OnInputKey(keyId, keyName, isDown)
	if keyName == "W" then
		return false
	end
end

Related Pages