A demo input method for macOS based on Swift and CMake, forked from ensan-hcl/macOS_IMKitSample_2021.
This project is for developers who don't like deprecated Objective-C and ugly .xcodeproj.
brew install swiftlint ninja
pip install "dmgbuild[badge_icons]"cmake -B build -G Ninja \
-DARCH=[native|x86_64|arm64] \
-DCMAKE_BUILD_TYPE=Release
cmake --build buildEither open build/Toyimk.dmg
(if prompted Toyimk is in use error,
execute pkill Toyimk and retry), or
sudo cmake --install build- On first time installation,
logout your account and login,
then in
System Settings->Keyboard->Input Sources, addToyimkfromEnglish. - On further installations,
switch to another input method,
pkill Toyimk, then switch back. - You may change what is committed at
client.insertin controller.swift to make sure your changes take effect.
Yes, though being a system module, input method is debuggable. However, you need another machine to do it.
$ ssh your-mac
$ /usr/bin/lldb
(lldb) process attach --name Toyimk
(lldb) b inputText
(lldb) cNow switch to Toyimk and hit a key.