2.7.0 SP2 // PKG installer fix. Merge PR#146 from upd/2.7.0sp2
This commit is contained in:
commit
0ec0542c66
|
@ -4,7 +4,7 @@ TARGET='vChewing'
|
|||
login_user=$(/usr/bin/stat -f%Su /dev/console)
|
||||
|
||||
OS_Version=$(sw_vers -productVersion)
|
||||
if [[ ${OS_Version} < 12.0.0 ]]; then
|
||||
##### if [[ ${OS_Version} < 12.0.0 ]]; then
|
||||
# Copy the wrongfully installed contents to the right location:
|
||||
cp -r /Library/Input\ Methods/"${TARGET}".app /Users/"${login_user}"/Library/Input\ Methods/ || true
|
||||
cp -r /Library/Keyboard\ Layouts/"${TARGET}"* /Users/"${login_user}"/Library/Keyboard\ Layouts/ || true
|
||||
|
@ -16,7 +16,7 @@ if [[ ${OS_Version} < 12.0.0 ]]; then
|
|||
rm -rf /Library/Input\ Methods/"${TARGET}".app || true
|
||||
rm -rf /Library/Keyboard\ Layouts/"${TARGET}"* || true
|
||||
sleep 1
|
||||
fi
|
||||
##### fi
|
||||
|
||||
# Finally, register the input method:
|
||||
/Users/"${login_user}"/Library/Input\ Methods/"${TARGET}".app/Contents/MacOS/"${TARGET}" install --all || true
|
||||
|
|
|
@ -39,7 +39,13 @@ class ctlInputMethod: IMKInputController {
|
|||
// MARK: -
|
||||
|
||||
/// 當前這個 ctlInputMethod 副本是否處於英數輸入模式。
|
||||
var isASCIIMode = false { didSet { setKeyLayout() } }
|
||||
var isASCIIMode = false {
|
||||
didSet {
|
||||
resetKeyHandler()
|
||||
setKeyLayout()
|
||||
}
|
||||
}
|
||||
|
||||
/// 按鍵調度模組的副本。
|
||||
var keyHandler = KeyHandler(lm: LMMgr.currentLM(), uom: LMMgr.currentUOM(), pref: PrefMgr.shared)
|
||||
/// 用以記錄當前輸入法狀態的變數。
|
||||
|
@ -53,13 +59,6 @@ class ctlInputMethod: IMKInputController {
|
|||
/// - Remark: 警告:該工具必須為 Struct 且全專案只能有一個唯一初期化副本。否則會在動 CapsLock 的時候誤以為是在摁 Shift。
|
||||
static var theShiftKeyDetector = ShiftKeyUpChecker(useLShift: PrefMgr.shared.togglingAlphanumericalModeWithLShift)
|
||||
|
||||
/// 切換當前 ctlInputMethod 副本的英數輸入模式開關。
|
||||
func toggleASCIIMode() -> Bool {
|
||||
resetKeyHandler()
|
||||
isASCIIMode.toggle()
|
||||
return isASCIIMode
|
||||
}
|
||||
|
||||
/// `handle(event:)` 會利用這個參數判定某次 Shift 按鍵是否用來切換中英文輸入。
|
||||
var rencentKeyHandledByKeyHandlerEtc = false
|
||||
|
||||
|
@ -274,7 +273,7 @@ class ctlInputMethod: IMKInputController {
|
|||
if Self.theShiftKeyDetector.check(event), !PrefMgr.shared.disableShiftTogglingAlphanumericalMode {
|
||||
if !shouldUseShiftToggleHandle || (!rencentKeyHandledByKeyHandlerEtc && shouldUseShiftToggleHandle) {
|
||||
NotifierController.notify(
|
||||
message: toggleASCIIMode()
|
||||
message: isASCIIMode.toggled()
|
||||
? NSLocalizedString("Alphanumerical Input Mode", comment: "")
|
||||
: NSLocalizedString("Chinese Input Mode", comment: "")
|
||||
)
|
||||
|
@ -288,6 +287,9 @@ class ctlInputMethod: IMKInputController {
|
|||
|
||||
// MARK: 針對客體的具體處理
|
||||
|
||||
// 不再讓威注音處理由 Shift 切換到的英文模式的按鍵輸入。
|
||||
if isASCIIMode { return false }
|
||||
|
||||
/// 這裡仍舊需要判斷 flags。之前使輸入法狀態卡住無法敲漢字的問題已在 KeyHandler 內修復。
|
||||
/// 這裡不判斷 flags 的話,用方向鍵前後定位光標之後,再次試圖觸發組字區時、反而會在首次按鍵時失敗。
|
||||
/// 同時注意:必須在 event.type == .flagsChanged 結尾插入 return false,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.7.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2701</string>
|
||||
<string>2702</string>
|
||||
<key>UpdateInfoEndpoint</key>
|
||||
<string>https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist</string>
|
||||
<key>UpdateInfoSite</key>
|
||||
|
|
|
@ -1280,7 +1280,7 @@
|
|||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
|
@ -1320,7 +1320,7 @@
|
|||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
|
@ -1359,7 +1359,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
|
@ -1411,7 +1411,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
|
@ -1545,7 +1545,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
@ -1605,7 +1605,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
@ -1651,7 +1651,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
|
@ -1695,7 +1695,7 @@
|
|||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2701;
|
||||
CURRENT_PROJECT_VERSION = 2702;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
|
|
Loading…
Reference in New Issue