onClientCharacter
Client-side
Server-side
Shared
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
element: The source of this event is the client's root element.
Code Examples
client
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 characterendaddEventHandler("onClientCharacter", getRootElement(), outputPressedCharacter)
See Also
Input Events
- onClientCharacter
- onClientClick
- onClientCursorMove
- onClientDoubleClick
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIFocus
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientKey
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
- onClientPaste
Input Functions
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- toggleControl
- unbindKey
- getAnalogControlState
- getCommandsBoundToKey
- getBoundKeys
- getKeyBoundToCommand
- getKeyState
- isCapsLockEnabled
- setAnalogControlState
- isKeyBound