OnClientCharacter: Difference between revisions
Jump to navigation
Jump to search
ThePiotrek (talk | contribs) mNo edit summary |
m (→See Also) |
||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
<syntaxhighlight lang="lua">string character | <syntaxhighlight lang="lua">string character | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* '''character''': | * '''character''': a [[string]] representing the pressed character. | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the client's [[root element]]. | The [[event system#Event source|source]] of this event is the client's [[root element]]. | ||
Line 25: | Line 26: | ||
==See Also== | ==See Also== | ||
{{GUI_events}} | {{GUI_events}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} |
Latest revision as of 14:28, 20 May 2018
This event triggers whenever the user presses an alphanumeric character on their keyboard. This also includes special characters, ie. " / # % [ ] { }.
Parameters
string character
- character: a string representing the pressed character.
Source
The source of this event is the client's root element.
Example
This example will output the pressed character in the chatbox.
function outputPressedCharacter(character) if character==" " then --if the character is a space character = "space" --change 'character' to 'space' end outputChatBox("You pressed the character "..character.."!") --output the character end addEventHandler("onClientCharacter", getRootElement(), outputPressedCharacter)
See Also
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled