GetKeyboardLayout: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Move Needs_Example template down)
m (copy from https://docs.microsoft.com/en-us/windows/win32/intl/locale-ireadinglayout)
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{Client function}}
{{Client function}}
{{New feature/item|3.0157|1.5.6|18866|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.}}
{{New feature/item|3.0157|1.5.6|18866|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.}}
{{Needs_Example}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">table getKeyboardLayout()</syntaxhighlight>
<syntaxhighlight lang="lua">table getKeyboardLayout ()</syntaxhighlight>


===Returns===
===Returns===
Line 21: Line 20:
     | <code>"rtl"</code> || Right to left (Arabic, Hebrew)
     | <code>"rtl"</code> || Right to left (Arabic, Hebrew)
     |-
     |-
     | <code>"ttb-rtl-ltr"</code> || Vertical top to bottom with columns to the left and also left to right (Japanese)
     | <code>"ttb-rtl-ltr"</code> || Either read vertically from top to bottom with columns going from right to left, or read in horizontal rows from left to right, as for the Japanese (Japan) locale.
     |-
     |-
     | <code>"ttb-ltr"</code> || Vertical top to bottom with columns proceeding to the right (Mongolian)
     | <code>"ttb-ltr"</code> || Read vertically from top to bottom with columns going from left to right, as for the Mongolian (Mongolian) locale.
     |}
     |}
|}
|}


==Example==
==Example==
-- TODO
<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}}

Latest revision as of 11:23, 18 October 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" Either read vertically from top to bottom with columns going from right to left, or read in horizontal rows from left to right, as for the Japanese (Japan) locale.
"ttb-ltr" Read vertically from top to bottom with columns going from left to right, as for the Mongolian (Mongolian) locale.

Example

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

See Also