IsShiftPressed: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
AddEvent("OnKeyPress", function(key) | |||
if IsShiftPressed() and key == 'R' then | |||
AddPlayerChat("You have pressed Shift + R") | |||
end | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:KeyFunctions}} |
Latest revision as of 16:11, 19 November 2019
Description
Check if the client has pressed the Shift key
Syntax
IsShiftPressed()
Parameters
- This function has no parameters.
Return Value
- Returns true if pressed, otherwise false
Example
AddEvent("OnKeyPress", function(key)
if IsShiftPressed() and key == 'R' then
AddPlayerChat("You have pressed Shift + R")
end
end)