# Module `fcitx`

Fcitx module

## Functions

call_by_name (function_name, ...) | Call a global function by its name.
version () | Get the version of fcitx.
lastCommit () | Get the last committed string.
splitString (str, delim) | a helper function to split the string by delimiter.
log (str) | a helper function to send Debug level log to fcitx.
watchEvent (event, function) | Watch for a event from fcitx.
unwatchEvent (id) | Unwatch a certain event.
currentInputMethod () | Return the current input method.
setCurrentInputMethod (name) | Change the current input method
currentProgram () | Return the current program name
addConverter (function) | Add a string converter for committing string.
removeConverter (id) | Remove a converter.
addQuickPhraseHandler (function) | Add a quick phrase handler.
removeQuickPhraseHandler (id) | Remove a quickphrase handler.
commitString (str) | Commit string to current input context.
standardPathLocate (type, path, suffix) | Locate all files with given path and suffix.
UTF16ToUTF8 (str) | Helper function to convert UTF16 string to UTF8.
UTF8ToUTF16 (str) | Helper function to convert UTF8 string to UTF16.

## Tables

KeyState | The lua version of fcitx::KeyState.
StandardPath | The lua version of fcitx::StandardPath::Type.
QuickPhraseAction | The lua version of fcitx::QuickPhraseAction.
EventType | The lua version of fcitx::EventType.

## Functions

call_by_name (function_name, ...)
  Call a global function by its name.

  ### Parameters:

  - function_name name of the function
  - ... the arguments forwarded to the function.

  ### Returns:

  nil if function is not found, or the return value of the function.
version ()
  Get the version of fcitx.

  ### Returns:

  string The version of fcitx.
lastCommit ()
  Get the last committed string.

  ### Returns:

  string The last commit string from fcitx.
splitString (str, delim)
  a helper function to split the string by delimiter.

  ### Parameters:

  - str string string to be split.
  - delim string string used as delimiter.

  ### Returns:

  table An array of string split by delimiter, empty string will be skipped.
log (str)
  a helper function to send Debug level log to fcitx.

  ### Parameters:

  - str string log string.
watchEvent (event, function)
  Watch for a event from fcitx.

  ### Parameters:

  - event int Event Type.
  - function string the function name.

  ### Returns:

  A unique integer identifier.

  ### See also:

  EventType
unwatchEvent (id)
  Unwatch a certain event.

  ### Parameters:

  - id int id of the watcher.

  ### See also:

  watchEvent
currentInputMethod ()
  Return the current input method.

  ### Returns:

  string the unique string of current input method.
setCurrentInputMethod (name)
  Change the current input method

  ### Parameters:

  - name string the unique string of the input method name.
currentProgram ()
  Return the current program name

  ### Returns:

  string the string of current program name.
addConverter (function)
  Add a string converter for committing string.

  ### Parameters:

  - function string the function name.

  ### Returns:

  int A unique integer identifier.
removeConverter (id)
  Remove a converter.

  ### Parameters:

  - id int id of this converter.

  ### See also:

  addConverter
addQuickPhraseHandler (function)
  Add a quick phrase handler.

  ### Parameters:

  - function string the function name.

  ### Returns:

  int A unique integer identifier.
removeQuickPhraseHandler (id)
  Remove a quickphrase handler.

  ### Parameters:

  - id int id of this handler.

  ### See also:

  addQuickPhraseHandler
commitString (str)
  Commit string to current input context.

  ### Parameters:

  - str string string to be commit to input context.
standardPathLocate (type, path, suffix)
  Locate all files with given path and suffix.

  ### Parameters:

  - type int
  - path string
  - suffix string

  ### Returns:

  table A table of full file name.

  ### See also:

  StandardPath
UTF16ToUTF8 (str)
  Helper function to convert UTF16 string to UTF8.

  ### Parameters:

  - str string UTF16 string.

  ### Returns:

  string UTF8 string or empty string if it fails.
UTF8ToUTF16 (str)
  Helper function to convert UTF8 string to UTF16.

  ### Parameters:

  - str string UTF8 string.

  ### Returns:

  string UTF16 string or empty string if it fails.

## Tables

KeyState
  The lua version of fcitx::KeyState. It represent the value of modifier keys.

  ### Fields:

  - None
  - Shift
  - CapsLock
  - Ctrl
  - Alt
  - NumLock
  - Mod3
  - Super
  - Mod5
  - MousePressed
  - HandledMask
  - IgnoredMask
  - Super2
  - Hyper
  - Meta
  - UsedMask
StandardPath
  The lua version of fcitx::StandardPath::Type. It represent the value of different type of directory.

  ### Fields:

  - Config
  - PkgConfig
  - Data
  - Cache
  - Runtime
  - Addon
  - PkgData
QuickPhraseAction
  The lua version of fcitx::QuickPhraseAction. It represent the different value that can be returned from quickphrase handler.

  ### Fields:

  - Break
  - Commit
  - TypeToBuffer
  - DigitSelection
  - AlphaSelection
  - NoneSelection
  - DoNothing
  - AutoCommit
EventType
  The lua version of fcitx::EventType. It represent the value of different type of events.

  ### Fields:

  - ContextCreated
  - ContextDestroyed
  - FocusOut
  - FocusIn
  - KeyEvent
  - SurroundingTextUpdated
  - CursorRectChanged
  - SwitchInputMethod
  - InputMethodActivated
  - InputMethodDeactivated
  - CommitString
  - UpdatePreedit

generated by LDoc 1.4.6 Last updated 2021-01-31 07:31:38