GetKeyboardLayout: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(One intermediate revision by the same user not shown)
Line 27: Line 27:


==Example==
==Example==
{{Example}}
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
addCommandHandler("layout", function()
    outputConsole( inspect( getKeyboardLayout() ) )--output keyboard layout in console (F8)
end)
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Client_utility_functions}}
{{Client_utility_functions}}

Revision as of 20:37, 5 April 2020

This function gets the player's keyboard layout settings, which they are currently (keyboard layout can be changed at any moment) using at the time of invocation.

Syntax

table getKeyboardLayout ()

Returns

Returns a table with keyboard layout properties:

Property Values and description
readingLayout
"ltr" Left to right (English)
"rtl" Right to left (Arabic, Hebrew)
"ttb-rtl-ltr" Vertical top to bottom with columns to the left and also left to right (Japanese)
"ttb-ltr" Vertical top to bottom with columns proceeding to the right (Mongolian)

Example

Click to collapse [-]
Client
addCommandHandler("layout", function()
    outputConsole( inspect( getKeyboardLayout() ) )--output keyboard layout in console (F8)
end)

See Also