Skip to content

AlphabetKey 字母键

最常用的按键类型:点击发送 main 字符,滑动发送 alt 字符。

字段

字段类型必填说明
typestring固定为 "AlphabetKey"
mainstring主字符(通常一个字符),如 "Q" / "中"
altstring滑动备用字符,如 "1"
displayTextstring | map自定义键面显示文本,详见 overview
composeOverrideobject输入过程中样式覆盖;见 Compose Override
weight / rowHeightPercent / 颜色字段共通字段相同

字符与按键事件

  • main 一般是一个字符;输入法(Fcitx)会将其作为按键事件处理(拼音方案下会进入候选流程)
  • alt 在用户滑动该键时发送
  • 编辑器会要求 main / alt 都是单个字符;如果不需要滑动备用行为,使用 SymbolKeyMacroKey 更合适
  • 如果需要发送一段字符串、或更复杂行为,使用 MacroKey

示例

json
{ "type": "AlphabetKey", "main": "Q", "alt": "1" }

按方案区分显示文字(仓颉显示偏旁、其他方案显示字母):

json
{
  "type": "AlphabetKey",
  "main": "Q",
  "alt": "1",
  "displayText": { "倉頡五代": "手" }
}

相关页面

本项目基于 fcitx5-android/fcitx5-android 修改。源码与文档以 LGPL-2.1 发布。