https://github.com/eagleoflqj/toyimk
Demo input method for macOS, with CMake and Swift, without Xcode
https://github.com/eagleoflqj/toyimk
cmake inputmethodkit macos swift
Last synced: about 1 month ago
JSON representation
Demo input method for macOS, with CMake and Swift, without Xcode
- Host: GitHub
- URL: https://github.com/eagleoflqj/toyimk
- Owner: eagleoflqj
- License: mit
- Created: 2023-12-15T23:07:33.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-20T02:01:03.000Z (over 1 year ago)
- Last Synced: 2025-04-06T06:59:08.851Z (about 2 months ago)
- Topics: cmake, inputmethodkit, macos, swift
- Language: Swift
- Homepage:
- Size: 41 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Toyimk
A demo input method for macOS based on Swift and CMake,
forked from [ensan-hcl/macOS_IMKitSample_2021](https://github.com/ensan-hcl/macOS_IMKitSample_2021).This project is for developers who don't like deprecated Objective-C and ugly `.xcodeproj`.
## Install dependencies
```sh
brew install swiftlint ninja
pip install "dmgbuild[badge_icons]"
```## Build
```sh
cmake -B build -G Ninja \
-DARCH=[native|x86_64|arm64] \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
```## Install
Either open `build/Toyimk.dmg`
(if prompted Toyimk is in use error,
execute `pkill Toyimk` and retry), or
```sh
sudo cmake --install build
```
* On first time installation,
logout your account and login,
then in `System Settings` -> `Keyboard` -> `Input Sources`,
add `Toyimk` from `English`.
* On further installations,
switch to another input method,
`pkill Toyimk`,
then switch back.
* You may change what is committed at `client.insert` in [controller.swift](src/controller.swift) to make sure your changes take effect.## Debug
Yes, though being a system module, input method is debuggable.
However, you need another machine to do it.
```sh
$ ssh your-mac
$ /usr/bin/lldb
(lldb) process attach --name Toyimk
(lldb) b inputText
(lldb) c
```
Now switch to Toyimk and hit a key.