feat(settings): 新设置程序的候选页加上小键盘数字(Windows)

#354 只接了旧版 Windows 设置;新设置程序是主入口,按平台支持表只在 Windows 显示,macOS、Linux 记为待实现。文档同步到按键页与设置页。
This commit is contained in:
yenharvey
2026-10-26 11:28:47 +08:00
parent ff843799fc
commit 4f37e9fd65
8 changed files with 40 additions and 5 deletions
+6
View File
@@ -31,6 +31,12 @@ const LINKS: &[(PageId, &str, &str, &str)] = &[
(PageId::Input, "笔画", "input/aux-code", "码表"),
(PageId::Input, "导入码表", "input/aux-code", "码表"),
(PageId::Candidates, "译文", "learning/translation", "译词"),
(
PageId::Candidates,
"小键盘数字",
"getting-started/keys",
"打拼音时",
),
(PageId::Candidates, "输出字形", "input/traditional", "开启"),
(
PageId::Candidates,
+7 -1
View File
@@ -44,11 +44,13 @@ pub enum Feature {
ShowTones,
/// 「实验功能」页:下载、启用知意与含章·知微。
ExperimentalModels,
/// 中文组句中的小键盘数字:选候选还是进组句。
NumpadDigit,
}
impl Feature {
#[cfg(test)]
pub const ALL: [Self; 20] = [
pub const ALL: [Self; 21] = [
Self::AuxCode,
Self::Schemes,
Self::SwitchKeys,
@@ -69,6 +71,7 @@ impl Feature {
Self::KeyHint,
Self::ShowTones,
Self::ExperimentalModels,
Self::NumpadDigit,
];
/// 当前平台显示这一项。
@@ -116,6 +119,7 @@ impl Feature {
Self::ShowTones => [Yes, Yes, Todo],
// Windows、Linux 的服务进程还没接知意;没有 GPU 时 CPU 上打分要发烫,先只开 macOS(Metal)
Self::ExperimentalModels => [Yes, Yes, Todo],
Self::NumpadDigit => [Todo, Yes, Todo],
}
}
@@ -143,6 +147,7 @@ impl Feature {
Self::KeyHint => "双拼键位提示",
Self::ShowTones => "拼音行显示声调",
Self::ExperimentalModels => "实验功能(知意、含章·知微)",
Self::NumpadDigit => "小键盘数字",
}
}
@@ -173,6 +178,7 @@ impl Feature {
Self::VocabularyTranslation => &[(PageId::Cloud, "生词本整句翻译")],
Self::KeyHint => &[(PageId::Input, "键位提示")],
Self::ShowTones => &[(PageId::Candidates, "拼音行显示声调")],
Self::NumpadDigit => &[(PageId::Candidates, "小键盘数字")],
Self::SystemCtrlSpace
| Self::EnglishPunctuation
| Self::StatusBar
+20 -2
View File
@@ -3,12 +3,12 @@
use bamboo_slip::taffy::NodeId;
use bamboo_slip::{RenderError, SettingRow, Stepper, Ui, group, section_title};
use qingjian_core::{ENGLISH_CANDIDATES_MAX, LEARNING_LANGUAGES, TraditionalVariant};
use qingjian_platform::{EmojiCount, MAX_PAGE_SIZE};
use qingjian_platform::{EmojiCount, MAX_PAGE_SIZE, NumpadDigit};
use crate::message::{Message, Popup};
use crate::support::Feature;
use crate::view::Page;
use crate::view::parts::controls::{select, toggle_info, toggle_with};
use crate::view::parts::controls::{choice, select, toggle_info, toggle_with};
pub fn candidates(ui: &mut Ui<Message>, page: &Page) -> Result<Vec<NodeId>, RenderError> {
let theme = &page.theme;
@@ -72,6 +72,24 @@ pub fn candidates(ui: &mut Ui<Message>, page: &Page) -> Result<Vec<NodeId>, Rend
general.learning_language_off(),
)?,
];
if Feature::NumpadDigit.here() {
let numpad = choice(
ui,
page,
"numpad-digit",
&NumpadDigit::ALL,
general.numpad_digit,
NumpadDigit::label,
|value| Message::set("general", "numpad_digit", value.key()),
)?;
rows.insert(
1,
SettingRow::new("小键盘数字")
.info("组句中按小键盘数字")
.control(numpad)
.build(ui, theme)?,
);
}
if Feature::ShowTones.here() {
rows.push(toggle_info(
ui,
+1
View File
@@ -157,6 +157,7 @@
- [ ] 双拼键位提示:Linux
- [ ] 拼音行显示声调:Linux
- [ ] 实验功能(知意、含章·知微):Linux
- [ ] 小键盘数字:macOS、Linux
## 四、其他输入方案
+2
View File
@@ -44,6 +44,8 @@ Windows 与 Linux 的中 / 英切换键还可以选单击 `Ctrl` 或 `Ctrl + Alt
| 进入辅码 | `;` | `;` | — |
| 横排时展开成多行(需在设置中打开) | `↑` / `↓` | `↑` / `↓` | — |
Windows 上小键盘数字缺省也是选候选;在「设置 → 候选」把「小键盘数字」改成「直接输入数字」后,组句中按小键盘数字会把数字接在敲的字母后面,跟着一起上屏(`wenti` 再按小键盘 `5`、空格,得到 `wenti5`),主键盘数字照旧选候选。要开着 Num Lock。
光标停在拼音中间时,候选只按光标之前的拼音计算(`ni|hao` 出「你」);上屏后其余拼音保留,光标移到末尾。
大千注音与五笔下有几个键不同,见 [拼音方案与模糊音](../input/fuzzy-and-shuangpin.md#大千注音) 与 [五笔与混输](../input/wubi.md)。
+1 -1
View File
@@ -22,7 +22,7 @@ description: 打开设置的方法、搜索与 ⓘ 说明、设置窗口 12 页
| 页 | 内容 | 详见 |
|---|---|---|
| 输入 | 拼音方案(全拼、双拼、注音)、形码(五笔)、分次选词、键位提示、模糊音、辅码 | [拼音方案与模糊音](../input/fuzzy-and-shuangpin.md)、[五笔与混输](../input/wubi.md)、[辅码](../input/aux-code.md) |
| 候选 | 每页候选数、学习语言、词性、繁体、拼音带声调、emoji 与符号、学习输入习惯、本地整句模型、英文词 | [候选旁的译词](../learning/translation.md)、[繁体输出](../input/traditional.md)、[整句、简拼与纠错](../input/sentence.md) |
| 候选 | 每页候选数、小键盘数字(Windows)、学习语言、词性、繁体、拼音带声调、emoji 与符号、学习输入习惯、本地整句模型、英文词 | [候选旁的译词](../learning/translation.md)、[繁体输出](../input/traditional.md)、[整句、简拼与纠错](../input/sentence.md) |
| 中英文 | 英文模式、切换键、默认模式、按应用记住、英文候选、标点、自动空格、悬浮状态条 | [中英文](../input/english-mode.md)、[标点、符号与表情](../input/punctuation.md) |
| 外观 | 主题、深浅色、横排竖排、拼音位置、字体与字号、动画 | [外观与主题](../personalize/appearance.md) |
| 快捷键 | 翻页键、高亮移动键、前缀字母、译词的修饰键、翻译与 AI 联想的快捷键 | [改按键](../personalize/keys-settings.md) |
@@ -44,6 +44,8 @@ On Windows and Linux, the Chinese / English switch can also be a tap of `Ctrl` o
| Enter auxiliary code | `;` | `;` | — |
| Expand to several rows in horizontal layout (enable in Settings) | `↑` / `↓` | `↑` / `↓` | — |
On Windows, numpad digits also pick candidates by default. Set 小键盘数字 (Numpad digits) under 设置 → 候选 (Settings → Candidates) to 直接输入数字 (Type digits) and numpad digits typed while composing are appended to the letters and committed with them (`wenti`, then numpad `5` and `Space`, gives `wenti5`); the main keyboard digits still pick candidates. Num Lock must be on.
When the cursor is in the middle of the pinyin, candidates are based only on the pinyin before the cursor (`ni|hao` gives 你); after committing, the rest of the pinyin stays and the cursor moves to the end.
A few keys differ with Dachen Zhuyin and Wubi; see [Pinyin schemes and fuzzy pinyin](../input/fuzzy-and-shuangpin.md#Dachen-Zhuyin) and [Wubi and mixed input](../input/wubi.md).
@@ -24,7 +24,7 @@ Settings that exist only on some platforms are hidden on the others; settings th
| Page | Contents | Details |
|---|---|---|
| 输入 (Input) | Pinyin scheme (full pinyin, double pinyin, Zhuyin), shape-based input (Wubi), picking in steps, key hints, fuzzy pinyin, auxiliary code | [Pinyin schemes and fuzzy pinyin](../input/fuzzy-and-shuangpin.md), [Wubi and mixed input](../input/wubi.md), [Auxiliary code](../input/aux-code.md) |
| 候选 (Candidates) | Candidates per page, learning language, part of speech, Traditional Chinese, pinyin with tones, emoji and symbols, learning your habits, local sentence model, English words | [Glosses beside candidates](../learning/translation.md), [Traditional Chinese output](../input/traditional.md), [Sentences, abbreviations and correction](../input/sentence.md) |
| 候选 (Candidates) | Candidates per page, numpad digits (Windows), learning language, part of speech, Traditional Chinese, pinyin with tones, emoji and symbols, learning your habits, local sentence model, English words | [Glosses beside candidates](../learning/translation.md), [Traditional Chinese output](../input/traditional.md), [Sentences, abbreviations and correction](../input/sentence.md) |
| 中英文 (Chinese/English) | English mode, switch key, default mode, remembering per app, English candidates, punctuation, automatic spaces, floating status bar | [Chinese and English](../input/english-mode.md), [Punctuation, symbols and emoji](../input/punctuation.md) |
| 外观 (Appearance) | Theme, light/dark, horizontal/vertical layout, pinyin position, fonts and sizes, animation | [Appearance and themes](../personalize/appearance.md) |
| 快捷键 (Shortcuts) | Paging keys, highlight keys, prefix letters, modifiers for glosses, shortcuts for translation and AI suggestions | [Changing keys](../personalize/keys-settings.md) |