OnKeyPress

From Onset Developer Wiki
Revision as of 11:39, 23 March 2019 by BlueMountains (talk | contribs) (Created page with "{{Info|Event|Client|1.0}} {{FuncDescription|Called when the player presses a key. You can use IsCtrlPressed and IsShiftPressed to check if it is a key combination.}}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
OnKeyPress

Type: Event
Context: Client
Introduced: v1.0

Description

Called when the player presses a key. You can use IsCtrlPressed and IsShiftPressed to check if it is a key combination.

Syntax

OnKeyPress(key)

Parameters

  • key
    The name of the key as a string.

Example

function OnKeyPress(key)
	AddPlayerChat(key)
	if key == "Tab" then
		AddPlayerChat("You have pressed TAB!")
	end
end
AddEvent("OnKeyPress", OnKeyPress)

See also

Game

Vehicle

Player

Weapon

Parachuting

Key

NPC

Object

Package

Pickup

Text

Vehicle

Web UI

Sound

Door

Network