fix: 移除alt跳转存在多平台不一致的多种问题,移除龙三

This commit is contained in:
amzxyz
2025-12-06 21:14:54 +08:00
parent 91f84d15ce
commit 03bac03c16
6 changed files with 14 additions and 162 deletions

View File

@@ -68,7 +68,6 @@ engine:
- recognizer #与 matcher 搭配,处理符合特定规则的输入码,如网址、反查等 tags
- key_binder #在特定条件下将按键绑定到其他按键,如重定义逗号、句号为候选翻页、开关快捷键等
- lua_processor@*key_binder #绑定按键扩展能力,支持正则扩展将按键生效情景更加细化
- lua_processor@*alt_jump #通过alt+字母进行跳转输入编码对应的字母非完全版asdt等按键被rime屏蔽了
- speller #拼写处理器,接受字符按键,编辑输入
- punctuator #符号处理器,将单个字符按键直接映射为标点符号或文字
- selector #选字处理器,处理数字选字键〔可以换成别的哦〕、上、下候选定位、换页

View File

@@ -908,6 +908,7 @@ LAN口 LAN'kǒu
LED灯 LED'dēng
LED屏 LED'píng
LY-1 LY-1
Low帧 Low'zhēn
M3U8 M3U8
MSKU MSKU
Mac版 Mac'bǎn

View File

@@ -42242,8 +42242,9 @@ sort: by_weight
光口 guāng kǒu 444
广口 guǎng kǒu 368
广阔 guǎng kuò 661
光来 guāng lái 503
逛来 guàng lái 489
广濑 guǎng lài 463
光来 guāng lái 403
光缆 guāng lǎn 520
光阑 guāng lán 246
桄榔 guāng láng 285
@@ -66195,8 +66196,8 @@ sort: by_weight
考评 kǎo píng 573
靠谱 kào pǔ 701
烤漆 kǎo qī 526
靠齐 kào qí 419
考期 kǎo qī 376
靠齐 kào qí 319
靠前 kào qián 668
考前 kǎo qián 647
靠墙 kào qiáng 537
@@ -701183,9 +701184,8 @@ sort: by_weight
我是装 wǒ shì zhuāng 212
我是追 wǒ shì zhuī 206
我是准 wǒ shì zhǔn 201
我是 wǒ shì zhuó 73
我是 wǒ shì zì 420
我市自 wǒ shì zì 285
我是自 wǒ shì zì 220
我狮子 wǒ shī zi 162
我识字 wǒ shí zì 155
我失踪 wǒ shī zōng 102
@@ -701924,8 +701924,8 @@ sort: by_weight
我岁我 wǒ suì wǒ 348
我随我 wǒ suí wǒ 62
我虽无 wǒ suī wú 389
我随意 wǒ suí yì 580
我虽已 wǒ suī yǐ 415
我随意 wǒ suí yì 180
我岁有 wǒ suì yǒu 309
我虽有 wǒ suī yǒu 58
我岁月 wǒ suì yuè 157
@@ -724488,6 +724488,8 @@ sort: by_weight
先知蛋 xiān zhī dàn 114
先知道 xiān zhī dào 232
限制到 xiàn zhì dào 186
闲置的 xián zhì de 392
限制的 xiàn zhì de 301
闲置地 xián zhì dì 130
限制点 xiàn zhì diǎn 98
限制多 xiàn zhì duō 175
@@ -812541,6 +812543,7 @@ sort: by_weight
找我哎 zhǎo wǒ āi 73
找我吧 zhǎo wǒ ba 216
找我爸 zhǎo wǒ bà 157
找我的 zhǎo wǒ de 311
照我的 zhào wǒ de 177
找我换 zhǎo wǒ huàn 49
找我家 zhǎo wǒ jiā 104
@@ -813294,6 +813297,8 @@ sort: by_weight
这个饭 zhè ge fàn 217
这个分 zhè ge fēn 216
这个符 zhè ge fú 100
这个高 zhè ge gāo 295
这个搞 zhè ge gǎo 245
这个歌 zhè ge gē 202
这个给 zhè ge gěi 200
这个梗 zhè ge gěng 253
@@ -814314,6 +814319,7 @@ sort: by_weight
这是想 zhè shì xiǎng 185
这是些 zhè shì xiē 138
这是要 zhè shì yào 154
这是有 zhè shì yǒu 298
这是由 zhè shì yóu 277
这是咋 zhè shì zǎ 141
这是在 zhè shì zài 316
@@ -1208604,6 +1208610,8 @@ sort: by_weight
偏大一码 piān dà yì mǎ 14
偏带观测 piān dài guān cè 2
骗到手了 piàn dào shǒu le 24
偏到右边 piān dào yòu biān 24
偏到左边 piān dào zuǒ biān 24
偏的地方 piān de dì fāng 37
骗都不骗 piàn dōu bú piàn 12
片段长度 piàn duàn cháng dù 10

View File

@@ -1,90 +0,0 @@
-- amzxyz@https://github.com/amzxyz/rime_wanxiang
-- lua/alt_jump.lua
-- Alt + 字母把输入法光标跳到对应字母后面系统占用了asdt等几个按键不起作用暂时不没办法
-- 多个相同字母时轮询跳转i > caret
local wanxiang = require("wanxiang")
local R = wanxiang.RIME_PROCESS_RESULTS -- 简化引用(可选)
----------------------------------------------------------------------
-- 移动光标到“下一个 ch 后面”,并支持轮询
----------------------------------------------------------------------
local function move_to_next_char(context, ch)
local input = context.input
if not input or input == "" then
return false
end
local len = #input
local caret = context.caret_pos
if type(caret) ~= "number" then
caret = 0
end
local first_pos = nil
local next_pos = nil
for i = 1, len do
if input:sub(i, i) == ch then
if not first_pos then
first_pos = i
end
-- ⚠️ 核心:必须是 i > caret而不是 i >= caret
if (i > caret) and (not next_pos) then
next_pos = i
end
end
end
if not first_pos then
return false
end
-- 若后面没有相同字母 → 回圈到第一个
local target = next_pos or first_pos
context.caret_pos = target
context:refresh_non_confirmed_composition()
return true
end
----------------------------------------------------------------------
-- 主处理器:拦截 Alt + 字母
----------------------------------------------------------------------
local function processor(key, env)
local context = env.engine.context
if key:release() then
return R.kNoop
end
if not key:alt() then
return R.kNoop
end
if not context:is_composing() then
return R.kNoop
end
local code = key.keycode
if not code then
return R.kNoop
end
local ch
if code >= string.byte("a") and code <= string.byte("z") then
ch = string.char(code)
elseif code >= string.byte("A") and code <= string.byte("Z") then
ch = string.char(code + 32)
else
return R.kNoop
end
if move_to_next_char(context, ch) then
return R.kAccepted
else
return R.kNoop
end
end
return processor

View File

@@ -64,7 +64,6 @@ engine:
- recognizer #与 matcher 搭配,处理符合特定规则的输入码,如网址、反查等 tags
- key_binder #在特定条件下将按键绑定到其他按键,如重定义逗号、句号为候选翻页、开关快捷键等
- lua_processor@*key_binder #绑定按键扩展能力,支持正则扩展将按键生效情景更加细化
- lua_processor@*alt_jump #通过alt+字母进行跳转输入编码对应的字母非完全版asdt等按键被rime屏蔽了
- speller #拼写处理器,接受字符按键,编辑输入
- punctuator #符号处理器,将单个字符按键直接映射为标点符号或文字
- selector #选字处理器,处理数字选字键〔可以换成别的哦〕、上、下候选定位、换页

View File

@@ -1254,71 +1254,6 @@ pro:
- xform/^(.)(ú|iāng|iang|ěng|ǔn)(;.*)$/$1M$3/
- xlit/QWERTYUIOPASDFGHMJCKLZXVBN/qwertyuiopasdfghmjcklzxvbn/
龙三:
__append:
- xform/^ēr/e¥/
- xform/^ér/e¥/
- xform/^ěr/e¥/
- xform/^èr/e&/
- xform/^er/e&/
- xform/^(ā|á|ǎ|à)([ioun])/a$1$2/
- xform/^(ō|ó|ǒ|ò)([ioun])/o$1$2/
- xform/^(ē|é|ě|è)([ioun])/e$1$2/
- xform/^(ā|á|ǎ|à)(ng)/a$1$2/
- xform/^(ō|ó|ǒ|ò)(ng)/o$1$2/
- xform/^(ē|é|ě|è)(ng)/e$1$2/
- xform/^(ā|á|ǎ|à)/a$1/
- xform/^(ō|ó|ǒ|ò)/o$1/
- xform/^(ē|é|ě|è)/e$1/
- xform/^([jqxy])u(;.*)/$1ü$2/
- xform/^([jqxy])ū(;.*)/$1ǖ$2/
- xform/^([jqxy])ú(;.*)/$1ǘ$2/
- xform/^([jqxy])ǔ(;.*)/$1ǚ$2/
- xform/^([jqxy])ù(;.*)/$1ǜ$2/
- xform/^a(;.*)$/aā$1/
- xform/^o(;.*)$/oō$1/
- xform/^e(;.*)$/eē$1/
- xform/^ǹg/nèng/
- xform/^ňg/něng/
- xform/^ńg/néng/
- xform/^ng/neng/
- xform/^ǹ/eèn/
- xform/^ň/eěn/
- xform/^ń/eén/
- xform/^n(;.*)/een$1/
- xform/^sh/U/
- xform/^ch/I/
- xform/^zh/V/
- xform/^y/E/
- xform/^p/Y/
- xform/^e/P/
- xform/^(.)(āo|àng|ang|ióng|iǒng|iú|iǔ|iù|iu|uǎ|uá)(;.*)$/$1Q$3/
- xform/^(.)(iā|uàng|uang|ó|ǒ|òu|ou|ún|ǔn)(;.*)$/$1W$3/
- xform/^(.)(iān|é|ě)(;.*)$/$1E$3/
- xform/^(.)(|án|ǎn|iào|iao)(;.*)$/$1R$3/
- xform/^(.)(áng|ǎng|ián|iǎn|uài|uai)(;.*)$/$1T$3/
- xform/^(.)(ìng|ing|ú|ǔ)(;.*)$/$1Y$3/
- xform/^(.)(è|e|ēi|iē|iū)(;.*)$/$1U$3/
- xform/^(.)(ā|ào|uī|ǖ|iàng|iang)(;.*)$/$1I$3/
- xform/^(.)(í|ǐ|uó|uǒ)(;.*)$/$1O$3/
- xform/^(.)(iāng|ù|u|ǘ|ǚ)(;.*)$/$1P$3/
- xform/^(.)(ì|i|uà|ua)(;.*)$/$1A$3/
- xform/^(.)(àn|an|iáng|iǎng|iòng|iong|uǐ|uí|ūn)(;.*)$/$1S$3/
- xform/^(.)(éng|ěng|īng|uā|ùn|un)(;.*)$/$1D$3/
- xform/^(.)(āi|ēng|iá|iǎ|ín|ǐn|iōng|uàn|uan|ér|ěr)(;.*)$/$1F$3/
- xform/^(.)(íng|ǐng|ū)(;.*)$/$1G$3/
- xform/^(.)(ài|ai|iāo|uán|uǎn)(;.*)$/$1H$3/
- xform/^(.)(én|ěn|òng|ong|uò|uo|üé|ǚe|ué|uě)(;.*)$/$1J$3/
- xform/^(.)(èi|ei|ōng|in|ìn|uō|üè|üe|uè|ue)(;.*)$/$1K$3/
- xform/^(.)(éi|ěi|ī|uáng|uǎng)(;.*)$/$1L$3/
- xform/^(.)(áo|ǎo|ié|iě|uāng|ǖe|uē)(;.*)$/$1Z$3/
- xform/^(.)(āng|iáo|iǎo|ò|o|uái|uǎi)(;.*)$/$1X$3/
- xform/^(.)(á|ǎ|ái|ǎi|ià|ia|ōu|uāi|èr|er)(;.*)$/$1C$3/
- xform/^(.)(èng|eng|ō|ǜ|ü|uì|ui)(;.*)$/$1V$3/
- xform/^(.)(ān|ē|iè|ie)(;.*)$/$1B$3/
- xform/^(.)(èn|en|iàn|ian|óu|ǒu|uān)(;.*)$/$1N$3/
- xform/^(.)(à|a|ēn|īn|óng|ǒng)(;.*)$/$1M$3/
- xlit/QWERTYUIOPASDFGHMJCKLZXVBN¥&/qwertyuiopasdfghmjcklzxvbnfc/
小鹤双拼:
__append:
- xform/Ⅲ// #用于Lua判断输入类型的标记