Appkb is a project mainly written in C++ and C, it's free.
MacキーボードでIMEを操作できるようにします。
Please see here.