Compare commits

...
4 Commits
Author SHA1 Message Date
ays953 cfd095b3b0 Release v0.13.2 2026-11-13 17:08:09 +08:00
ays953andClaude Opus 5.5 f323a29552 Don't open Keyboard settings on every Shift tap
InputModes.select called TISEnableInputSource before every switch, and macOS
opens System Settings > Keyboard whenever a source is enabled, even one that is
already enabled. Enable only when the mode is not enabled yet (also in
--register).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:07:49 +08:00
ays953 aa00b793ce Release v0.13.1 2026-11-13 17:03:26 +08:00
ays953andClaude Opus 5.5 b3b7589379 Name the input modes in System Settings
The modes showed their raw IDs (com.autozhuyin.inputmethod.AutoZhuyin.Auto).
InfoPlist.strings (zh-Hant, en, Base) now name them 自動注音(中英自動) and
自動注音(英文); build.sh copies the .lproj folders into the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:03:07 +08:00
7 changed files with 34 additions and 7 deletions
+6
View File
@@ -0,0 +1,6 @@
/* Names shown in System Settings and the input menu. */
CFBundleName = "自動注音";
CFBundleDisplayName = "自動注音";
"com.autozhuyin.inputmethod.AutoZhuyin" = "自動注音";
"com.autozhuyin.inputmethod.AutoZhuyin.Auto" = "自動注音(中英自動)";
"com.autozhuyin.inputmethod.AutoZhuyin.English" = "自動注音(英文)";
+2 -2
View File
@@ -15,9 +15,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.13.0</string> <string>0.13.2</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>21</string> <string>23</string>
<key>ComponentInputModeDict</key> <key>ComponentInputModeDict</key>
<dict> <dict>
<key>tsInputModeListKey</key> <key>tsInputModeListKey</key>
+6
View File
@@ -0,0 +1,6 @@
/* Names shown in System Settings and the input menu. */
CFBundleName = "AutoZhuyin";
CFBundleDisplayName = "AutoZhuyin";
"com.autozhuyin.inputmethod.AutoZhuyin" = "AutoZhuyin";
"com.autozhuyin.inputmethod.AutoZhuyin.Auto" = "AutoZhuyin (Auto)";
"com.autozhuyin.inputmethod.AutoZhuyin.English" = "AutoZhuyin (English)";
@@ -0,0 +1,6 @@
/* Names shown in System Settings and the input menu. */
CFBundleName = "自動注音";
CFBundleDisplayName = "自動注音";
"com.autozhuyin.inputmethod.AutoZhuyin" = "自動注音";
"com.autozhuyin.inputmethod.AutoZhuyin.Auto" = "自動注音(中英自動)";
"com.autozhuyin.inputmethod.AutoZhuyin.English" = "自動注音(英文)";
+11 -4
View File
@@ -15,18 +15,25 @@ enum InputModes {
return list.first return list.first
} }
/// Makes the given mode current (enabling it first if needed). Returns false on failure. private static func isEnabled(_ src: TISInputSource) -> Bool {
guard let p = TISGetInputSourceProperty(src, kTISPropertyInputSourceIsEnabled) else { return false }
return CFBooleanGetValue(Unmanaged<CFBoolean>.fromOpaque(p).takeUnretainedValue())
}
/// Makes the given mode current. Returns false on failure.
/// Only enables the mode if it is not enabled yet: TISEnableInputSource opens System
/// Settings → Keyboard, even for a source that is already enabled.
@discardableResult @discardableResult
static func select(english: Bool) -> Bool { static func select(english: Bool) -> Bool {
guard let src = source(english ? InputModes.english : InputModes.auto) else { return false } guard let src = source(english ? InputModes.english : InputModes.auto) else { return false }
TISEnableInputSource(src) if !isEnabled(src) { TISEnableInputSource(src) }
return TISSelectInputSource(src) == noErr return TISSelectInputSource(src) == noErr
} }
/// Called by `--register`: enable both modes so they are in the input menu. /// Called by `--register`: enable both modes (if not yet) so they are in the input menu.
static func enableAll() { static func enableAll() {
for id in [auto, english] { for id in [auto, english] {
if let src = source(id) { TISEnableInputSource(src) } if let src = source(id), !isEnabled(src) { TISEnableInputSource(src) }
} }
} }
} }
+2
View File
@@ -18,6 +18,8 @@ rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp "$BIN" "$APP/Contents/MacOS/AutoZhuyin" cp "$BIN" "$APP/Contents/MacOS/AutoZhuyin"
cp Resources/Info.plist "$APP/Contents/Info.plist" cp Resources/Info.plist "$APP/Contents/Info.plist"
# Localized names of the input method and its modes (System Settings, input menu).
cp -R Resources/*.lproj "$APP/Contents/Resources/"
cp Resources/lexicon.txt Resources/english-common.txt Resources/classifier-weights.json "$APP/Contents/Resources/" cp Resources/lexicon.txt Resources/english-common.txt Resources/classifier-weights.json "$APP/Contents/Resources/"
cp THIRD_PARTY_LICENSES.txt "$APP/Contents/Resources/" cp THIRD_PARTY_LICENSES.txt "$APP/Contents/Resources/"
# "AI 選字" language model (CKIP gpt2-tiny-chinese, GPL-3.0), fetched and converted once. # "AI 選字" language model (CKIP gpt2-tiny-chinese, GPL-3.0), fetched and converted once.
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "自動注音 AutoZhuyin", "name": "自動注音 AutoZhuyin",
"version": "0.13.0", "version": "0.13.2",
"guid": "{3895C6E3-6D40-4B4B-B4EA-CEEC75382D23}", "guid": "{3895C6E3-6D40-4B4B-B4EA-CEEC75382D23}",
"locale": "zh-Hant-TW", "locale": "zh-Hant-TW",
"fallbackLocale": "zh-TW", "fallbackLocale": "zh-TW",