Closed weearc closed 11 months ago
看了一下如果简单的用如下方式绑定到按键实现语言切换:
- action: shortCommand(#中英切换)
label: "🖇"
的确可以用 ascii_mode
切换语言,但是此时要是 label
不绑定任何值则该按键显示为空(不显示为当前status),要是使用 keyboardType
的话:
- action: keyboardType(alphabetic) # 可以切换到英文键盘,但是布局为默认英文键盘
- action: keyboardType(EN) # EN 为自己定义的西文键盘布局,但当前状态没变(中文仍为中文,英文仍为英文)
看了一下相关issue,需求应该类似于 #367 ,因为目前如果在布局文件中给一个按键定义两个 action
的话后一个必定覆盖前一个,但是这个确实也不应该通过多action来做,因此还是需要label显示绑定状态
目前一个变通方法是切换到另一个布局(假定为西文输入)时所有字母按键配置 processByRIME: false
,可暂时性达到目的。
附键盘布局:
keyboards:
- name: ZH
rows:
- keys:
- action: character(q)
width: percentage(0.1)
- action: character(w)
width: percentage(0.1)
- action: character(e)
width: percentage(0.1)
- action: character(r)
width: percentage(0.1)
- action: character(t)
width: percentage(0.1)
- action: character(y)
width: percentage(0.1)
- action: character(u)
width: percentage(0.1)
- action: character(i)
width: percentage(0.1)
- action: character(o)
width: percentage(0.1)
- action: character(p)
width: percentage(0.1)
- keys:
- action: none
width: available
- action: character(a)
width: percentage(0.1)
- action: character(s)
width: percentage(0.1)
- action: character(d)
width: percentage(0.1)
- action: character(f)
width: percentage(0.1)
- action: character(g)
width: percentage(0.1)
- action: character(h)
width: percentage(0.1)
- action: character(j)
width: percentage(0.1)
- action: character(k)
width: percentage(0.1)
- action: character(l)
width: percentage(0.1)
- action: none
width: available
- keys:
- action: shift
width: percentage(0.13)
- action: none
width: available
- action: character(z)
width: percentage(0.1)
- action: character(x)
width: percentage(0.1)
- action: character(c)
width: percentage(0.1)
- action: character(v)
width: percentage(0.1)
- action: character(b)
width: percentage(0.1)
- action: character(n)
width: percentage(0.1)
- action: character(m)
width: percentage(0.1)
- action: none
width: available
- action: backspace
width: percentage(0.13)
- keys:
- action: keyboardType(numericNineGrid)
width:
portrait: percentage(0.15)
landscape: percentage(0.2)
- action: keyboardType(custom(EN))
label: ""
width:
portrait: percentage(0.08)
landscape: percentage(0.1)
- action: character(,)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: space
label: "Clover"
width: available
- action: character(。)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: enter
width:
portrait: percentage(0.14)
landscape: percentage(0.1)
buttonInsets: left(0),bottom(0),top(0),right(0)
- name: EN
rows:
- keys:
- action: character(q)
processByRIME: false
width: percentage(0.1)
- action: character(w)
processByRIME: false
width: percentage(0.1)
- action: character(e)
processByRIME: false
width: percentage(0.1)
- action: character(r)
processByRIME: false
width: percentage(0.1)
- action: character(t)
processByRIME: false
width: percentage(0.1)
- action: character(y)
processByRIME: false
width: percentage(0.1)
- action: character(u)
processByRIME: false
width: percentage(0.1)
- action: character(i)
processByRIME: false
width: percentage(0.1)
- action: character(o)
processByRIME: false
width: percentage(0.1)
- action: character(p)
processByRIME: false
width: percentage(0.1)
- keys:
- action: none
width: available
- action: character(a)
processByRIME: false
width: percentage(0.1)
- action: character(s)
processByRIME: false
width: percentage(0.1)
- action: character(d)
processByRIME: false
width: percentage(0.1)
- action: character(f)
processByRIME: false
width: percentage(0.1)
- action: character(g)
processByRIME: false
width: percentage(0.1)
- action: character(h)
processByRIME: false
width: percentage(0.1)
- action: character(j)
processByRIME: false
width: percentage(0.1)
- action: character(k)
processByRIME: false
width: percentage(0.1)
- action: character(l)
processByRIME: false
width: percentage(0.1)
- action: none
width: available
- keys:
- action: shift
width: percentage(0.13)
- action: none
width: available
- action: character(z)
processByRIME: false
width: percentage(0.1)
- action: character(x)
processByRIME: false
width: percentage(0.1)
- action: character(c)
processByRIME: false
width: percentage(0.1)
- action: character(v)
processByRIME: false
width: percentage(0.1)
- action: character(b)
processByRIME: false
width: percentage(0.1)
- action: character(n)
processByRIME: false
width: percentage(0.1)
- action: character(m)
processByRIME: false
width: percentage(0.1)
- action: none
width: available
- action: backspace
width: percentage(0.13)
- keys:
- action: keyboardType(numericNineGrid)
width:
portrait: percentage(0.15)
landscape: percentage(0.2)
- action: keyboardType(custom(ZH))
label: "EN"
width:
portrait: percentage(0.08)
landscape: percentage(0.1)
- action: character(,)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: space
label: "Clover"
width: available
- action: character(.)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: enter
width:
portrait: percentage(0.14)
landscape: percentage(0.1)
buttonInsets: left(0),bottom(0),top(0),right(0)
另:大写按键在使用自定义布局时,在未双击锁定状态下,输入第二个字符后不会回到关闭状态。
遇到了同样的问题(中英文切换按钮在空格左右横跳) 同时这个中英的按钮似乎贴图拉伸有点问题,现在是一个长方形 之前是正方形 看着很难看
确认到更新后问题已经修复,关闭此issue
类似 #391 启用中英文切换按键并设置为空格左侧后,中文下位置如图所示 英文键盘如下所示 希望能够保持切换后位置或给出可以自定义默认键盘布局的配置文件或开关。另:启用自定义布局或配色后,尽管已经将边框大小设置为0且圆角大小设置为0仍显示了圆角 目前自定义布局没法应用在英文输入面板上,因此切换后是默认布局。附配置文件