Skip to content

Commit

Permalink
feat: 添加输入法相关日志
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertyyb committed Apr 13, 2024
1 parent 3b9018f commit 8c09bfb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Fire/InputSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class InputSource {
if !isEnabled() {
// 全新安装或未启用过,需要Register, 已启用的,不需要再次启用
let installedLocationURL = NSURL(fileURLWithPath: installLocation)
TISRegisterInputSource(installedLocationURL as CFURL)
NSLog("register input source")
let err = TISRegisterInputSource(installedLocationURL as CFURL)
NSLog("register input source: \(err)")
}
}

Expand Down Expand Up @@ -69,11 +69,11 @@ class InputSource {
guard let result = self.findInputSource(forUsage: .selected) else {
return
}
TISSelectInputSource(result)
let err = TISSelectInputSource(result)
NSLog("select input source: \(err)")
let isSelected = CFBooleanGetValue(Unmanaged<CFBoolean>.fromOpaque(
TISGetInputSourceProperty(result, kTISPropertyInputSourceIsSelected)
).takeUnretainedValue())
NSLog("Selected input source")
if isSelected {
timer.invalidate()
callback(true)
Expand All @@ -89,8 +89,8 @@ class InputSource {
TISGetInputSourceProperty(result, kTISPropertyInputSourceIsEnabled)
).takeUnretainedValue())
if !enabled {
TISEnableInputSource(result)
NSLog("Enabled input source")
let err = TISEnableInputSource(result)
NSLog("Enabled input source: \(err)")
}
}

Expand Down

0 comments on commit 8c09bfb

Please sign in to comment.