Skip to content

Releases: CommandPrompt-Wang/BetterZUIKey-SogouOEMExt

搜狗输入法联想版增强 v1.2.2

Choose a tag to compare

@CommandPrompt-Wang CommandPrompt-Wang released this 20 Sep 19:27

搜狗输入法联想版增强 v1.2.2

摘要

本次更新围绕用户交互细节展开,引入了三个新功能:更好的软硬键盘切换、选区与分词修复、解除快捷键设置限制。同时,修复了模块自身的一个老问题与搜狗原生行为的一个问题。完善了操作界面。

完整变更: 4-1.2.1...5-1.2.2

新增功能

三个新开关已加入插件设置。

  • 更好的软硬键盘切换(默认关)
    原版输入法状态管理混乱,所谓的“软硬键盘切换”只是临时开关软键盘而已。下次触摸文本框进入编辑时,依然会不顾是否连接物理键盘直接弹出软键盘。我们重新设计了状态机,改用了更直观更稳定的交互逻辑:
    • 物理键盘模式下,点输入框不再弹出软键盘;软键盘模式下触摸输入框则正常弹出
    • 切换到软键盘模式:搜狗的软硬切换热键(输入法设置-外接键盘设置-软硬键盘切换) / 输入法工具栏最右侧的软键盘按钮 / 在 2 秒内重复进入同一文本框(进入-退出-进入) / 长按插件该设置条目(更好的软硬键盘切换)
    • 切换到物理键盘模式:直接用物理键盘打字,或长按相应设置条目
    • 设置条目内有 [查看切换规则] 说明页,在其中也会显示你当前设置的热键
    • 滚动区右下角新增悬浮的“刷新状态”按钮,可供不同步时手动刷新各状态位
  • 选区与分词修复(默认开)
    部分输入框重写了渲染和工作方法,导致 Shift/Ctrl+方向键无法选字/选词。
    开启后由模块接管推进:Shift+←/→ 逐字、Ctrl+←/→ 按词、Ctrl+Shift+←/→ 按词选。
  • 解除快捷键设置限制(默认关)
    搜狗“外接键盘设置”默认不允许录入 Alt/Shift+字母的组合,开启后可录入。
    解除限制后,快捷键是否冲突/被上层抢占需自行判断;特别提醒 Shift+字母系大写切换键,请谨慎设置。

修复:模块

  • Ctrl+Shift 修饰的热键被意外消费:严格模式原来在按住 Ctrl 时会把 Shift 一起消费掉而无视其他情况,条件过宽,导致输入法内任何 Ctrl+Shift 修饰的快捷键都难以正常工作。现在收紧了拦截位点,可以正常使用。
  • 智能编号:光标被移开后本应恢复中文标点,而此前仍会继续编号。现已修复,与"跳过已存在的闭合符号"的效果保持一致。

修复:搜狗原生

  • 无法设置两个空热键:搜狗把"空"当成一个普通值参与唯一性比较,因此无法将两个热键都设为空(后来者会报冲突)。现补全了空值判断。“该年龄已被占用”、“该性别已被占用”

界面

  • 插件界面上的全半角、中文标点、键盘模式等状态现在改为异步同步,可以通过刷新按钮(见下)实时查看。
  • 滚动区右下角新增刷新按钮,可强制刷新各状态位状态。

说明

  • 开启“更好的软硬键盘切换”后,软键盘态下操作物理键盘会自动切到物理键盘
  • 若没有在搜狗输入法配置软硬切换热键,仍然可以通过点击工具栏软键盘按钮、重复编辑同一文本框、长按插件设置条目来切回软键盘。反复强调
  • 其余详见插件内说明

搜狗输入法联想版增强 v1.2.1

Choose a tag to compare

@CommandPrompt-Wang CommandPrompt-Wang released this 19 Sep 18:49

搜狗输入法联想版增强 v1.2.1

摘要

本次更新为界面整理:设置项全部卡片化,语言暴露改为独立子页面,子页面统一顶栏与返回箭头。

完整变更: 3-1.2.0...4-1.2.1

界面

  • 设置项全部卡片化:严格模式、斜杠下拉等原先的裸行也套上卡片,整页版式统一。
  • 「选择在输入法框架中显示的语言」独立成子页面:勾选列表从首页搬进子页,首页只留一行入口
    (带说明)。存储格式不变,改完立即生效。
  • 子页面统一顶栏:改用标准 Toolbar + 系统返回箭头,与其它子页面同一套外观,系统返回键同样可用。
  • 修掉入口行的页边距:原先比其它条目更宽,现在与整页对齐。

搜狗输入法联想版增强 v1.2.0

Choose a tag to compare

@CommandPrompt-Wang CommandPrompt-Wang released this 18 Sep 12:53

搜狗输入法联想版增强 v1.2.0

摘要

本次更新着重增加新功能。实现了更完善的自动闭合、完整的 …… 和 ——;增加了广播通道,实现配置实时更新;完成了用户界面的美化和操作优化。

完整变更: 2-1.1.0...3-1.2.0

新功能

  • 选区自动补全(默认开,无快捷键):选中文本时按成对符号,把选区包起来而不是替换掉。
    选中 abc(abc),光标落在闭字符之后。符号箱、长按 z 的符号菜单、物理键盘三条路都支持。

  • 跳过已存在的闭合符号(默认开,无快捷键):光标后侧已有闭合符时,只把光标移过去、不再多补一个。

    • 判定使用实际字符,因此不会混淆全角 与半角 )
    • 手动移动光标后恢复正常闭合。换言之,点击/拖动过光标后仍会无条件打出闭合符
  • 完整的 …… 和 ——(默认开,无快捷键):输入 / 时输出两个;关闭则恢复搜狗原生单出。

  • 美化界面:美化了界面;三个带状态位的设置项显示「当前状态」,长按整卡可应急切换。

Bug 修复

  • 配置回滚:修复了语言/全角切换后立刻被回滚的问题。

其他

  • 配置通道:新增 ConfigPoke 广播,改完设置立刻生效(轮询退成 5 秒兜底)。
  • 图标:修正自适应图标前景。
  • 迁移功能:为保持功能集中和解耦,将 subtype 轮转排序迁移到 BetterZUIKey,请将后者更新至 v1.7.0 版本

搜狗输入法联想版增强 v1.1.0

Choose a tag to compare

@CommandPrompt-Wang CommandPrompt-Wang released this 17 Sep 11:07

搜狗输入法联想版增强 v1.1.0

Please scroll down for English / 英语请向下滚动

摘要

首个公开版本。本模块通过 LSPosed 注入联想 OEM 版搜狗输入法进程,用输入法自己的身份补出 中文(zh-CN) / English(en-US) 两个 subtype,把「只能用 Shift 切语言」的搜狗改造成由系统输入法框架驱动;并在此之上加入标点管线、引号/括号配对、中文态大写字母等增强。

完整变更: 本仓库首个版本,见 https://github.com/CommandPrompt-Wang/BetterZUIKey-SogouOEMExt/commits/main

新功能

  • 框架 subtype 驱动语言切换:在搜狗自己的 uid 下补入 subtype(绕开 IMMS 的 isSameApp 闸门),模块再把 subtype 变化翻译成搜狗内部的语言切换命令;幂等执行——先读搜狗真实语言,与目标一致就不动作,所以连按一一对应,不会「按一次切两次」。

  • 自定义语言顺序:首页拖动卡片排列切换顺序,分隔线上下分别决定哪些语言接入 / 不接入框架轮换(不接入的语言只能从搜狗键盘自己切)。

  • 严格模式(「只响应系统框架语言切换消息」,默认关):屏蔽搜狗原生切换键(物理 Ctrl+Shift、屏幕中/英键),语言只由框架 subtype 驱动。需要 BetterZUIKey v1.6.1 以上,否则输入法收不到任何消息。

  • 标点管线:把「语义层(中/英/数字/斜杠)」与「形式层(全/半角)」拆开,二者可独立切换。

    功能 说明 快捷键 默认
    智能中文标点 更合理的中文标点,+-*#[] 等使用半角
    全角模式 标点与数字全部输出全角( Shift+Space
    中英文标点 中文态下也输出 ASCII 标点 Ctrl+.
    智能编号 数字后的 改半角,形成 1. 2)
    原样输出斜杠 搜狗把 /\ 都输出成 ,可选一个原样保留
  • 中文态大写字母进拼音栏(默认开):中文态下 Shift+字母也整词进拼音,上屏时按记录的 Shift 意图还原大小写(DanceFeiChangHao)。切换快捷键 Ctrl+Shift+9

  • 引号 / 括号自动补全(默认关):软键盘打 → 自动补 并把光标移进中间。

  • 物理键盘自动补全(默认关):物理键盘打 → 模块注入 并移光标;Ctrl+Shift+9 可临时开关。

  • 编辑匹配列表:自定义「前-后」配对串,长度必须为偶数;默认 18 对建议值,支持分组换行;留空则回退搜狗原有匹配规则。

  • 配置热生效:每 2 秒按签名懒检查配置,改完设置重弹键盘即可生效,无需重启输入法进程

  • 与 BetterZUIKey 联动:检测到 BZK 时给出配置建议并解锁严格模式,未安装则置灰并提示安装。

  • 界面:Material 3 风格首页 + 内置「原理 / 说明」页;接入自适应图标;快捷键状态改用贴底横幅提示(搜狗进程的 Toast 会被系统按应用通知设置拦掉)。

已知限制

  • 五笔只在物理键盘(带工具栏)下可用,软键盘只有中/英。
  • 修改 subtype 集合时,若被移除的正是当前 subtype,框架可能重建一次输入法窗口。

其他

  • 仅针对联想 OEM 版搜狗(com.sohu.inputmethod.sogou.oem),对其他搜狗版本无效。
  • 逆向、踩坑与实测数据整理在仓库 PRINCIPLE.md。欢迎研究学习。

⚠ 安装与升级注意

  • 安装后在 LSPosed 中启用模块即可 —— 作用域由模块静态声明(staticScope=truecom.sohu.inputmethod.sogou.oem),无需也无法手动勾选;随后至少打开一次模块 App(否则 App 处于 stopped 状态,模块读不到配置),再杀死输入法进程并重新弹出键盘。
  • 需要 Android 8.1+ / LSPosed;严格模式需配合 BetterZUIKey v1.6.1 以上。
  • 本模块直接 hook 输入法的输入链路与提交链路。不当配置可能导致切不到某个语言、标点或配对行为异常,首次使用请先阅读内置「原理 / 说明」。

Sogou Input Method Lenovo OEM Enhancement v1.1.0

Highlights

First public release. This module injects into the Lenovo OEM build of Sogou IME via LSPosed and, under the IME's own identity, exposes Chinese (zh-CN) / English (en-US) subtypes — turning a keyboard whose language could only be switched with Shift into one driven by the system input method framework, plus punctuation, bracket pairing and uppercase-in-pinyin enhancements.

Full changelog: first release of this repository, see https://github.com/CommandPrompt-Wang/BetterZUIKey-SogouOEMExt/commits/main

New Features

  • Framework-subtype-driven language switching: subtypes are injected under Sogou's own uid (bypassing the IMMS isSameApp gate), and the module translates subtype changes into Sogou's internal language-switch commands. Execution is idempotent — it reads Sogou's real language first and does nothing if it already matches, so one press maps to exactly one switch.

  • Custom language order: drag cards on the home screen to order switching; the divider decides which languages are exposed to / hidden from the framework rotation (hidden ones can only be switched from Sogou's own keyboard).

  • Strict mode ("Only respond to framework language-switch messages", off by default): blocks Sogou's native switch keys (physical Ctrl+Shift, on-screen zh/en key); language is driven solely by framework subtypes. Requires BetterZUIKey v1.6.1 or later, otherwise the IME receives no messages at all.

  • Punctuation pipeline: separates the semantic layer (Chinese/English/digit/slash) from the form layer (full/half width), each switchable independently.

    Feature Description Shortcut Default
    Smart Chinese punctuation More sensible Chinese punctuation; +-*#[] etc. output half-width On
    Full-width mode All punctuation and digits output full-width ( ) Shift+Space On
    Chinese/English punctuation Output ASCII punctuation even in Chinese mode Ctrl+. On
    Smart numbering after digits become half-width, forming 1. 2) On
    Raw slash output Sogou turns both / and \ into ; keep one of them raw Off
  • Uppercase letters into the pinyin bar in Chinese mode (on by default): Shift+letter also enters the pinyin bar as a whole word, and the recorded Shift intent is replayed on commit (Dance, FeiChangHao). Toggle with Ctrl+Shift+9.

  • Quote / bracket auto-pairing (off by default): type on the soft keyboard → is inserted and the cursor moves inside.

  • Physical keyboard auto-pairing (off by default): type on a physical keyboard → the module injects and moves the cursor; Ctrl+Shift+9 toggles it temporarily.

  • Editable match list: custom "open-close" pairs, length must be even; 18 suggested pairs by default with grouping line breaks; empty falls back to Sogou's original rules.

  • Hot config reload: config signature is lazily checked every 2 seconds; reopen the keyboard after changing settings — no need to restart the IME process.

  • BetterZUIKey integration: when BZK is detected, configuration suggestions appear and strict mode is unlocked; otherwise the switch is greyed out with an install hint.

  • UI: Material 3 home screen plus a built-in "How it works" page; adaptive icon; shortcut status is shown as a bottom banner (Sogou-process toasts are suppressed by the system notification settings).

Known Limitations

  • Wubi is only available on a physical keyboard (with the toolbar); the soft keyboard only offers Chinese/English.
  • When the subtype set changes, the framework may rebuild the IME window once if the removed subtype was the current one.

Other

  • Targets the Lenovo OEM build of Sogou only (com.sohu.inputmethod.sogou.oem); ineffective on other Sogou builds.
  • Reverse-engineering notes, pitfalls and measurements are collected in PRINCIPLE.md. Contributions and study are welcome.

⚠ Install & Upgrade Notes

  • After installing, just enable the module in LSPosed — the scope is statically declared by the module (staticScope=true, com.sohu.inputmethod.sogou.oem) and neither needs nor allows manual selection. Then open the module app at least once (otherwise the app stays in the stopped state and the module cannot read the config), then kill the IME process and re-open the keyboard.
  • Requires Android 8.1+ / LSPosed; strict mode also needs BetterZUIKey v1.6.1 or later.
  • This module directly hooks the IME's input and commit paths. A bad configuration may cause a language to become unreachable or punctuation/pairing to misbehave — read the built-in "How it works" page first.