Skip to content

Commit bbbbf84

Browse files
committed
Scripting-Rime-Keyboard:fix:九键键盘下,英文键盘无法切换回九键
1 parent b06337b commit bbbbf84

1 file changed

Lines changed: 4 additions & 37 deletions

File tree

  • Scripting-Rime-Keyboard/keyboard

‎Scripting-Rime-Keyboard/keyboard/main.tsx‎

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ import {
7474
playPreparedConfiguredHaptic,
7575
prepareConfiguredHaptics,
7676
} from "./utils";
77-
import {
78-
ensureT9ProcessorLuaInstalled,
79-
T9_PROCESSOR_SCHEMA_ENTRY,
80-
} from "../t9ProcessorInstall";
77+
import { ensureT9ProcessorLuaInstalled } from "../t9ProcessorInstall";
8178

8279
function currentKeyboardAppearance(): KeyboardAppearance {
8380
const value = CustomKeyboard.traits?.keyboardAppearance;
@@ -1637,37 +1634,7 @@ function KeyboardContent(props: {
16371634
}
16381635
}
16391636

1640-
async function handleT9ProcessorSetupPrompt() {
1641-
await ensureT9ProcessorLuaInstalled();
1642-
const choice = await Dialog.actionSheet({
1643-
title: "启用九键拼音筛选",
1644-
message:
1645-
`请在九键方案配置 engine.processors 下加入:\n${T9_PROCESSOR_SCHEMA_ENTRY}`,
1646-
cancelButton: true,
1647-
actions: [
1648-
{ label: "确定" },
1649-
{ label: "修改" },
1650-
],
1651-
});
1652-
if (choice == null) return false;
1653-
await Pasteboard.setString(T9_PROCESSOR_SCHEMA_ENTRY);
1654-
if (choice === 1) {
1655-
const url = Script.createRunSingleURLScheme(Script.name, {
1656-
page: "rime-schemas",
1657-
});
1658-
try {
1659-
CustomKeyboard.dismiss();
1660-
} catch {}
1661-
setTimeout(() => {
1662-
void Safari.openURL(url);
1663-
}, 80);
1664-
}
1665-
return true;
1666-
}
1667-
1668-
async function switchEnglishQwertyToT9() {
1669-
const allowed = await handleT9ProcessorSetupPrompt();
1670-
if (!allowed) return;
1637+
function switchEnglishQwertyToT9() {
16711638
setKeyboardTypeOverride(null);
16721639
setSymbolLayer(false);
16731640
const s = sessionRef.current;
@@ -3244,8 +3211,7 @@ function KeyboardContent(props: {
32443211
moveCursorSafely,
32453212
pressMode: () => {
32463213
if (
3247-
keyboardTypeOverride === "qwerty" && settings.keyboardType === "t9" &&
3248-
ascii
3214+
keyboardTypeOverride === "qwerty" && settings.keyboardType === "t9"
32493215
) {
32503216
switchEnglishQwertyToT9();
32513217
return;
@@ -3330,6 +3296,7 @@ function KeyboardContent(props: {
33303296
bottomSpaceWidth,
33313297
bottomModeWidth,
33323298
bottomEnterWidth,
3299+
ascii,
33333300
composing,
33343301
settings.modeComposingEnabled,
33353302
isT9Keyboard,

0 commit comments

Comments
 (0)