qwertyyb / fire Goto Github PK
View Code? Open in Web Editor NEW使用Swift实现的Macos五笔输入法
Home Page: https://qwertyyb.github.io/Fire/
License: MIT License
使用Swift实现的Macos五笔输入法
Home Page: https://qwertyyb.github.io/Fire/
License: MIT License
可以增加这个功能吗,非常需要,用数字选词太慢了,目前我知道的是sogou和百度支持
版本:0.13.4
编码方案是:五笔
勾选 满4码唯一候选词直接上屏
尝试输入:五笔字形[空格],会上屏: ggttp陚
我更新了一下,还是找不到
❯ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing SQLCipher 4.5.3 (was 4.5.1)
Installing SwiftLint 0.51.0 (was 0.47.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 7 dependencies from the Podfile and 7 total pods installed.
[!] The `Fire [Debug]` target overrides the `PODS_CONFIGURATION_BUILD_DIR` build setting defined in `Pods/Target Support Files/Pods-Fire/Pods-Fire.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
在中文状态下,如果想不切换,也不用符号(;)临时切换,
直接输入英文: aBcD+回车(注意大小写)
最终会变成:BDac
这里应该有逻辑问题,当有字符没上屏时,shift+[a-z] 不能让大写先上屏
又碰到一个.
默认设置shift切换中英文
在微信中输入时, 微信中是用shift+回车 换行
然后会随机性的,很频繁的出现中文来回切换
用户自定义一些词组,保存下来
当我运行scripts/c_notorize_installer.sh
时,发现altool将在明年被停用,migrate到新的notarytool应该比较简单。See Apple's doc
Warning: altool has been deprecated and, starting in fall 2023, will no longer be supported by the Apple notary service. You should start using notarytool to notarize your software.
Fire/Fire/Utils/ModifierKeyUpChecker.swift
Lines 66 to 75 in fd324d6
这个函式正文最开头插入这一行:
guard checkKeyCode.contains(Int(event.keyCode)) else { return false }
不然的话,这个模组在某些情况下会把 CapsLock+字符键 给判断成 Shift 单击事件。
这个项目真的很好,生成的程序干净,体积小,出字速度快。感谢作者的付出!
有一个小问题, 比如我输入 e, 候选的有 "月, 有, .."
有应当是高频词,优先排在月前面,希望这里可以优化一下,加入手动调整候选顺序的功能
目前已发现的问题
在Alfred 4的输入框里,任何内容都输入不了,但是当前的输入法是Fire没错
Fire/Fire/CandidatesView.swift
Lines 128 to 151 in ede5b06
建议extract出来一个function给vertical和horizontal共用,这样就可以避免新功能out of sync的问题。这是一种写法:
var _indicator: some View {
let arrowUp = getIndicatorIcon(imageName: "arrowUp", direction: direction, activeFlag: hasPrev, eventName: State.prevPageBtnTapped)
let arrowDown = getIndicatorIcon(imageName: "arrowDown", direction: direction, activeFlag: hasNext, eventName: State.nextPageBtnTapped)
if direction == CandidatesDirection.horizontal {
return AnyView(VStack(spacing: 0) { arrowUp; arrowDown })
} else {
return AnyView(HStack(spacing: 4) { arrowUp; arrowDown })
}
}
func getIndicatorIcon(imageName: String, direction: CandidatesDirection, activeFlag: Bool, eventName: Notification.Name) -> some View {
return Image(imageName)
.renderingMode(.template)
.resizable()
.frame(width: 10, height: 10, alignment: .center)
.rotationEffect(Angle(degrees: direction == CandidatesDirection.horizontal ? 0 : -90), anchor: .center)
.onTapGesture {
if !activeFlag { return }
NotificationCenter.default.post(
name: eventName,
object: nil
)
}
.foregroundColor(Color(activeFlag
? themeConfig[colorScheme].pageIndicatorColor
: themeConfig[colorScheme].pageIndicatorDisabledColor
))
}
希望可以在中英文和数字之间自动添加空格
在输入一些按顺序的词不好对齐候选尤其在翻页后易错位,比如:罗马数字ⅰ ⅱ iii ...
我在微信里是中文输入,我设置了xcode为英文输入。我从微信切到xcode能正常变成英文输入。但是我切回微信时,一样是英文输入。
Fire是我用过的最好用的五笔输入法,非常感谢!有一个小问题,中文标点符号的双引号只能输半个,而不是成对出现,以前用过的输入法是这样设计的,按一次先上屏左半个,再按一次则上屏右半个。英文标点貌似左右半个都是一样的,可能不存在这样的问题。
最近想做一个mac的输入法,你的代码对我帮助非常大🙏。在学习代码的时候进行了一次全局搜索punctuation,结果没有找到任何使用的地方。仔细一看发现Punctuation好像都漏了个a,这种小笔误我也经常犯。
在这个函式最开头插入这句即可:
guard let event = event else { return }
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Fire [34680]
Path: /Library/Input Methods/Fire.app/Contents/MacOS/Fire
Identifier: com.qwertyyb.inputmethod.Fire
Version: v0.16.0 (20230506052003)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 502
Date/Time: 2023-05-29 20:06:41.3789 +0800
OS Version: macOS 13.4 (22F66)
Report Version: 12
Bridge OS Version: 7.5 (20P5058)
Anonymous UUID: 08378DA6-1F38-296F-EE86-338AA00FC385
Sleep/Wake UUID: 1F6DE16D-2E2F-4637-8E75-E0F39DD20DE8
Time Awake Since Boot: 85000 seconds
Time Since Wake: 3258 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 4 Illegal instruction: 4
Terminating Process: exc handler [34680]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 Fire 0x10e504c02 0x10e4f8000 + 52226
1 Fire 0x10e505261 0x10e4f8000 + 53857
2 InputMethodKit 0x7ff92b37170c -[IMKServer handleEvent_Common:characterIndex:edge:clientWrapper:controller:] + 697
3 InputMethodKit 0x7ff92b36686e __63-[IMKServer handleEvent:characterIndex:edge:asyncClient:reply:]_block_invoke_2 + 676
4 ViewBridge 0x7ff822b83a4a +[NSServiceViewController withHostAppAuditToken:invoke:] + 92
5 InputMethodKit 0x7ff92b3665be __63-[IMKServer handleEvent:characterIndex:edge:asyncClient:reply:]_block_invoke + 201
6 InputMethodKit 0x7ff92b373146 __IMKXPCPerformBlockOnMainThread_block_invoke + 25
7 CoreFoundation 0x7ff81adbdb71 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
8 CoreFoundation 0x7ff81adbdaaa __CFRunLoopDoBlocks + 398
9 CoreFoundation 0x7ff81adbcd7a __CFRunLoopRun + 2015
10 CoreFoundation 0x7ff81adbbf31 CFRunLoopRunSpecific + 560
11 HIToolbox 0x7ff824837dad RunCurrentEventLoopInMode + 292
12 HIToolbox 0x7ff824837bbe ReceiveNextEventCommon + 657
13 HIToolbox 0x7ff824837918 _BlockUntilNextEventMatchingListInModeWithFilter + 64
14 AppKit 0x7ff81de505d0 _DPSNextEvent + 858
15 AppKit 0x7ff81de4f47a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214
16 AppKit 0x7ff81de41ae8 -[NSApplication run] + 586
17 AppKit 0x7ff81de15d02 NSApplicationMain + 817
18 Fire 0x10e4fb609 0x10e4f8000 + 13833
19 dyld 0x7ff81a98841f start + 1903
使用了一下,整体很棒哈。
有个问题,没打几个字,cpu使用率有些高,截图:
CPU型号:
λ ~/ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
λ ~/
看了清歌输入法的公共模块,应该是用到了前缀树优化过
λ /Library/Input Methods/Qingg.app/Contents/Frameworks/ ll
total 0
drwxrwxrwx 5 xuxihai staff 160B 8 21 2019 CocoaLumberjack.framework
drwxrwxrwx 5 xuxihai staff 160B 8 21 2019 MASPreferences.framework
drwxrwxrwx 5 xuxihai staff 160B 8 21 2019 QinggTrie.framework
drwxrwxrwx 5 xuxihai staff 160B 8 21 2019 Sparkle.framework
drwxrwxrwx 5 xuxihai staff 160B 8 21 2019 TransitionKit.framework
在subtext或网页上输入是正常的,可以显示输入候选框,但是在钉钉的聊天里,直接不显示候选框,但是能输入
I can not find the input source in Preferences Settings
com.apple.loginwindow
#登录窗口
com.apple.SecurityAgent
#权限验证
com.apple.LocalAuthenticationRemoteService
#系统设置->密码
com.apple.Touch-ID-Settings.extension
#更改密码
能把这两个包默认英文吗
一个是用户登录窗口
一个是管理员权限验证窗口
百度/搜狗/清风 这几个都用过,这个问题都存在
经常会在密码输入窗口出现'中文输入'
也是因为这原因才另外找输入法
我不知道别人有没有这个问题,
也有可能因为我把系统自带的ABC给删了造成的 -_-!
因为不熟悉xcode, 依赖库的问题折腾了半天才跑起来,
然后才发现系统日志中能看到 -_-!
这两个包名都不知道是什么应用,估计要找配置文件改了.
建议作者在软件内置加上这两个配置,
我估计是强迫症研究了一下午 -_-!
已输入的内容没有上屏时(没有提交时)让客户端输入框失去焦点,应该要提交 _originalString 且隐藏候选框
输入法从系统输入法切换回业火时,能不能显示一下当前的中/英状态
我们在开发的时候大部分都是写英文的内容。个别输入的是中文。但不想手动切换输入法。如果可以默认英文,业火就可以直接默认输入法了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.