2 What is JKL?
BladeMight edited this page 2018-04-10 20:07:49 +03:00

So what is JKL?

JKL - Just Keyboard Layout, a program written in C/C++ that creates x64 and x32 WH_CALLWNDPROC hooks to monitor real layout change(listen to WM_INPUTLANGCHANGE).

How its used in Mahou?

JKL is written in C/C++ and Mahou is written in C#, so how do you think they can work together? Right there are many ways but the faster one on Windows is to use Windows Messages! First JKL generates windows message with RegisterWindowMessage WinAPI function, then saves its ID in umsg.id file, and then Mahou reads its value and waits for the messages by that ID to be received by HWND server in Mahou(just a hidden window with a constant class name). JKL meantime sends messages with that ID to Mahou's HWND server. That message has LParam and WParam which contain the layout and charset. Thats it, simple and efficient.