Skip to content

Demo input method for macOS, with CMake and Swift, without Xcode

License

Notifications You must be signed in to change notification settings

eagleoflqj/toyimk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toyimk

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.

Install dependencies

brew install swiftlint ninja
pip install "dmgbuild[badge_icons]"

Build

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

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 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.

$ ssh your-mac
$ /usr/bin/lldb
(lldb) process attach --name Toyimk
(lldb) b inputText
(lldb) c

Now switch to Toyimk and hit a key.

About

Demo input method for macOS, with CMake and Swift, without Xcode

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published