docs » InputMethodIndicator

Show input method indicator in the current mouse position. It is a small but noticable dot near the cursor. It can be very useful when you are using a non-ABC input method and often needs to switch between ABC and the non-ABC input method. You can use it as follows in the init.lua: hs.loadSpoon("InputMethodIndicator") spoon.InputMethodIndicator:start(nil) note: config parameter is a table, pass nil to use the default config the default config is as follows: { ABCColor = "#62C555", -- the dot color when the input method is ABC LocalLanguageColor = "#ED6A5E", -- the dot color when the input method is not ABC mode = "nearMouse", -- the mode of the indicator showOnChangeDuration = 3, -- seconds to show the indicator when the input method is changed checkInterval = .01, -- seconds to check the input method dotSize = 6, -- the size of the dot deltaY=7, -- the distance between the dot and the center of the selection or mouse } the mode can be "nearMouse","onChange","adaptive", the default mode is "adaptive" "nearMouse" means the indicator will always show near the mouse "onChange" means the indicator will show when the input method is changed and hide after showOnChangeDuration seconds "adaptive" means the indicator will show near the textarea when typing, otherwise it will show near the mouse Note: the "adaptive" mode is not perfect, it may not work in some apps because of the limitation of the accessibility API

API Overview

API Documentation

Methods

init
Signature InputMethodIndicator:init()
Type Method
Description

init.

Parameters
  • None
Returns
  • The InputMethodIndicator object
Source Source/InputMethodIndicator.spoon/init.lua line 67
start
Signature InputMethodIndicator:start(config)
Type Method
Description

Start InputMethodIndicator.

Parameters
  • config - A table contains config options for the module
    • ABCColor - the dot color when the input method is ABC
    • LocalLanguageColor - the dot color when the input method is not ABC
    • mode - the mode of the indicator
    • showOnChangeDuration - seconds to show the indicator when the input method is changed
    • checkInterval - seconds to check the input method
    • dotSize - the size of the dot
    • deltaY - the distance between the dot and the center of the selection or mouse
Returns
Source Source/InputMethodIndicator.spoon/init.lua line 200
stop
Signature InputMethodIndicator:stop()
Type Method
Description

Stop InputMethodIndicator.

Parameters
  • None
Returns
Source Source/InputMethodIndicator.spoon/init.lua line 245