librime-lua icon indicating copy to clipboard operation
librime-lua copied to clipboard

key_binder中的toggle怎么用?

Open lqqgis opened this issue 5 years ago • 1 comments

在下面的教程中看到了key_binder/bindings:whenaccesssend的用法,但是不知道toggle怎么用,可以举个例子么? https://github.com/LEOYoon-Tsaw/Rime_collections/blob/master/Rime_description.md

lqqgis avatar Oct 20 '20 06:10 lqqgis

local context=env.engine.context local ascii_mode=context:get_option("ascii_mode") context:set_option("ascii_mode" , not ascii_mode)

local function toggle(key) local value=context:get_option(key) context:set_option(key, not value) end

shewer avatar Oct 20 '20 09:10 shewer