diff --git a/apps/settings/src/support/mod.rs b/apps/settings/src/support/mod.rs index c6e636d6..d3ae9988 100644 --- a/apps/settings/src/support/mod.rs +++ b/apps/settings/src/support/mod.rs @@ -18,6 +18,8 @@ pub enum Feature { Schemes, /// 中英文切换键。 SwitchKeys, + /// 切换键里的单击 Ctrl 与 Ctrl + Alt + Space:macOS 只认单击 Shift。 + SwitchKeyCombos, /// 切换键里的「Ctrl + Space(系统)」:改的是 Windows 的系统热键。 SystemCtrlSpace, DefaultEnglish, @@ -50,10 +52,11 @@ pub enum Feature { impl Feature { #[cfg(test)] - pub const ALL: [Self; 21] = [ + pub const ALL: [Self; 22] = [ Self::AuxCode, Self::Schemes, Self::SwitchKeys, + Self::SwitchKeyCombos, Self::SystemCtrlSpace, Self::DefaultEnglish, Self::RememberModePerApp, @@ -94,8 +97,9 @@ impl Feature { match self { Self::AuxCode => [Yes, Yes, Todo], Self::Schemes => [Yes, Yes, Todo], - // macOS 用 Caps Lock,由系统决定 - Self::SwitchKeys => [No, Yes, Yes], + Self::SwitchKeys => [Yes, Yes, Yes], + // macOS 只做了单击 Shift,Caps Lock 仍是系统那一套 + Self::SwitchKeyCombos => [No, Yes, Yes], Self::SystemCtrlSpace => [No, Yes, No], Self::DefaultEnglish => [Todo, Yes, Yes], Self::RememberModePerApp => [Todo, Yes, Todo], @@ -130,6 +134,7 @@ impl Feature { Self::AuxCode => "辅码", Self::Schemes => "形码与自定义方案", Self::SwitchKeys => "中英文切换键", + Self::SwitchKeyCombos => "单击 Ctrl 与 Ctrl + Alt + Space 切换", Self::SystemCtrlSpace => "系统的 Ctrl + Space", Self::DefaultEnglish => "默认英文模式", Self::RememberModePerApp => "按应用记住中英模式", @@ -179,7 +184,8 @@ impl Feature { Self::KeyHint => &[(PageId::Input, "键位提示")], Self::ShowTones => &[(PageId::Candidates, "拼音行显示声调")], Self::NumpadDigit => &[(PageId::Candidates, "小键盘数字")], - Self::SystemCtrlSpace + Self::SwitchKeyCombos + | Self::SystemCtrlSpace | Self::EnglishPunctuation | Self::StatusBar | Self::HorizontalGrid diff --git a/apps/settings/src/view/pages/language.rs b/apps/settings/src/view/pages/language.rs index 7525506c..b88270af 100644 --- a/apps/settings/src/view/pages/language.rs +++ b/apps/settings/src/view/pages/language.rs @@ -185,10 +185,15 @@ fn width_label(full: bool) -> &'static str { } /// 中英切换键可以多选,一个都不勾就只剩按钮能切;最后一个是 Windows 自己的 Ctrl + Space,改的是系统设置。 +/// macOS 只有单击 Shift 一项,勾上后 Caps Lock 只管大小写。 fn switch_keys(ui: &mut Ui, page: &Page) -> Result { let keys = page.settings.config.shortcut.switch_mode; + let combos = Feature::SwitchKeyCombos.here(); let mut boxes = Vec::new(); for key in SwitchKey::ALL { + if !combos && key != SwitchKey::Shift { + continue; + } let on = keys.contains(key); let values = keys .with(key, !on) @@ -225,7 +230,13 @@ fn switch_keys(ui: &mut Ui, page: &Page) -> Result with_notice( ui, page, - SettingRow::new("切换键").info("可以多选").control(column), + SettingRow::new("切换键") + .info(if combos { + "可以多选" + } else { + "勾上后 Caps Lock 只管大小写" + }) + .control(column), "switch-keys", ) } diff --git a/docs/user/getting-started/keys.md b/docs/user/getting-started/keys.md index 59996cc2..07b09901 100644 --- a/docs/user/getting-started/keys.md +++ b/docs/user/getting-started/keys.md @@ -11,7 +11,7 @@ description: 青简在 macOS、Windows 与 Linux 上的缺省按键:切换、 | 操作 | macOS | Windows | Linux | |---|---|---|---| -| 中 / 英切换 | `Caps Lock`;在「偏好设置 → 快捷键」勾上「单击 Shift 切换中英文」后也可单击 `Shift`(此时 `Caps Lock` 只管大小写)。切换时屏幕右上角闪一个「中」/「英」提示 | 单击 `Shift`;系统的 `Ctrl + Space`;点任务栏或悬浮状态条上的「中 / 英」 | 单击 `Shift` | +| 中 / 英切换 | `Caps Lock`;在「设置 → 中英文」的「切换键」里勾上「单击 Shift」后也可单击 `Shift`(此时 `Caps Lock` 只管大小写)。切换时屏幕右上角闪一个「中」/「英」提示 | 单击 `Shift`;系统的 `Ctrl + Space`;点任务栏或悬浮状态条上的「中 / 英」 | 单击 `Shift` | | 直接输入大写英文 | 英文模式下按住 `⇧`;勾了单击 Shift 后 `Caps Lock` 亮着也是大写 | `Caps Lock` 亮起(中英模式均可) | `Caps Lock` 亮起 | | 输入拼音时临时打一个大写字母 | `⇧ + 字母` | `Shift + 字母` | `Shift + 字母` | | 切换全角 / 半角标点 | 可启用 `⌃ + .`(缺省关) | 点悬浮状态条上的「,。」格;可启用 `Ctrl + .`(缺省关) | — | diff --git a/docs/user/i18n/en/getting-started/keys.md b/docs/user/i18n/en/getting-started/keys.md index a5600e33..3443c417 100644 --- a/docs/user/i18n/en/getting-started/keys.md +++ b/docs/user/i18n/en/getting-started/keys.md @@ -11,7 +11,7 @@ For keys you can change, see [Changing keys](../personalize/keys-settings.md); A | Action | macOS | Windows | Linux | |---|---|---|---| -| Switch Chinese / English | `Caps Lock` | Tap `Shift`; the system's `Ctrl + Space`; click 中 / 英 on the taskbar or the floating status bar | Tap `Shift` | +| Switch Chinese / English | `Caps Lock`; after ticking 单击 Shift (Tap Shift) under 切换键 (Switch key) in 设置 → 中英文 (Settings → Chinese/English), also a tap of `Shift` (`Caps Lock` then only controls capitals). A 中 / 英 hint flashes in the top-right corner of the screen when you switch | Tap `Shift`; the system's `Ctrl + Space`; click 中 / 英 on the taskbar or the floating status bar | Tap `Shift` | | Type uppercase English directly | Hold `⇧` in English mode | `Caps Lock` on (in either mode) | `Caps Lock` on | | Type one capital letter while typing pinyin | `⇧ + letter` | `Shift + letter` | `Shift + letter` | | Switch full-width / half-width punctuation | `⌃ + .` can be enabled (off by default) | Click the ,。 cell on the floating status bar; `Ctrl + .` can be enabled (off by default) | — | diff --git a/docs/user/i18n/en/input/english-mode.md b/docs/user/i18n/en/input/english-mode.md index c92dbd97..12a1ad71 100644 --- a/docs/user/i18n/en/input/english-mode.md +++ b/docs/user/i18n/en/input/english-mode.md @@ -9,6 +9,10 @@ description: "Entering English mode, changing or turning off the Chinese/English - **macOS**: English mode is on while the `Caps Lock` light is on; turn it off to return to Chinese. If you want `Caps Lock` to switch between Qingjian and "ABC" the way the system pinyin input does, turn on the option to switch to ABC with Caps Lock in System Settings → Keyboard → Text Input → Edit: a quick press of `Caps Lock` then switches input methods and holding it still locks capitals; Qingjian's own English mode is no longer needed. + You can also tick 单击 Shift (Tap Shift) under 切换键 (Switch key) in 设置 → 中英文 (Settings → Chinese/English): a tap of `Shift` (press and release on its own) then switches between Chinese and English. + Leave it off if you often hit Shift by accident while typing. Once it's on, `Caps Lock` only controls capitals, so with it lit you type capital letters directly. + A 中 / 英 hint flashes in the top-right corner of the screen when you switch (with Tap Shift on, toggling `Caps Lock` flashes 大写 / 小写, capitals / lowercase). + **Tapping Shift while typing pinyin**: the letters you've typed are committed as they are (`nihao` → `nihao`) and English mode starts, so you don't need to press Enter first. - **Windows**: tap `Shift` (press and release on its own, without another key) to switch between Chinese and English. The taskbar shows 中 or 英 to match, and A while Caps Lock is on. Clicking the 中 / 英 icon on the taskbar also switches. On Windows, `Caps Lock` only controls case: while it's on, capital letters are typed directly in either mode (as with Microsoft Pinyin). diff --git a/docs/user/input/english-mode.md b/docs/user/input/english-mode.md index e50ce374..c1ead832 100644 --- a/docs/user/input/english-mode.md +++ b/docs/user/input/english-mode.md @@ -9,7 +9,7 @@ description: 进入英文模式、改掉或关掉中英切换、默认模式与 - **macOS**:`Caps Lock` 亮起为英文模式,熄灭回到中文。 想让 `Caps Lock` 像系统拼音那样在青简与「ABC」之间切换输入法,在「系统设置 → 键盘 → 文本输入 → 编辑」里打开用 Caps Lock 切换「ABC」的选项: 轻按 `Caps Lock` 切换输入法,按住仍是大写锁定;这时青简自己的英文模式就用不到了。 - 也可以在「偏好设置 → 快捷键」勾上「单击 Shift 切换中英文」:此后点一下 `Shift`(按下即松开、不与其他键组合)在中 / 英之间切换, + 也可以在「设置 → 中英文」的「切换键」里勾上「单击 Shift」:此后点一下 `Shift`(按下即松开、不与其他键组合)在中 / 英之间切换, 打字时误触 Shift 的话不用勾;勾上后 `Caps Lock` 退化成只管大小写,亮着直接输出大写英文。 切换的那一刻屏幕右上角会闪一个「中」/「英」提示(勾了单击 Shift 后,`Caps Lock` 切大小写也会闪「大写」/「小写」)。 **正在输入拼音时点 Shift**:已经敲的拼音按原样当英文上屏(`nihao` → `nihao`),再进入英文模式 —— 不用先回车再切。