Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ToggleLanguageState

From RoR Wiki

UI Lua API · Chat functions
Version: WAR 1.4.8

Switches the Windows input language by simulating a Shift+Alt key press.

ToggleLanguageState()

Arguments

None.

Returns

Nothing.

Details

  • The client sends four synthetic keyboard events to Windows: Shift down, Alt down, Shift up, Alt up. Windows treats this as its input-language hotkey, so the effect depends on the user's Windows keyboard settings.
  • The function reads no arguments; any arguments passed are ignored.
  • Use GetInputLanguageString to read the short name of the current input language afterwards.

Errors

None.

Example

From default/ea_chatwindow/source/chatwindow.lua:

function EA_ChatWindow.ToggleInputLanguage()
    ToggleLanguageState()   -- Call the registered C function that "presses" and "releases" the "Shift+Alt" keys.
    EA_ChatWindow.OnLanguageToggled()
    EA_ChatWindow.SwitchChannelWithExistingText (EA_TextEntryGroupEntryBoxTextInput.Text);
end

See also