O.K. I have read and understood the code. It is organized well enough.
To customize your layout edit the [layout] section of the layout.ini that, by default, is in PKL-root/layouts/layoutName/layout.ini.
Set the CapsState column to 8 on lines where you want to define a CapsLock and CapsLockSh. Other possible values for the CapsState are 0 that will block usage of columns past the first key definition, 1 to define only the shift state, 2 to define normal and Ctrl state, 6 to use AltGr, and the magic 8 to enable Caps and CapsSh columns. While the line in [global] "shiftstates = 0:1:2:6" is needed to enable AltGr and other modification states, state 8 and 9 are added in code so they should not be added manually.
The ini section has tab separated values and the first is the header that explains the purpose of that column. To see how the lay out works I needed to change my editor to show tabs and spaces and display tabs of 25 spaces. That way all of the columns lined up visually.
Here are three lines to give the idea. HotKey definitions use Auto Hot Key syntax, of course. To display properly I took out the tabs and lined up the columns using spaces, so these lines will not work by copy/paste!
Code:
;scan = VK CapState 0Norm 1Sh 2Ctrl 6AGr Caps CapsSh
SC003 = x 8 *VERY *GOOD -- -- {=}Caps{!} *{=}CapsSHift{!} ; QWERTY 2@
SC005 = 4 8 4 $ < > ( ) ; QWERTY 4$
SC004 = 3 8 *DO *HOWDY *== / \ *{home}{home}+{end}^c{end} ;
In the first line a missing * cause the output for CapsLock to display just as seen While the CapsSh will convert as expected. The last line shows my goal of using more complex actions on some keys. In my editor this copies the whole line and leaves the cursor at the end without any text selected; ready to press enter and paste, if that is the where I want to use the line. In testing the last line didn't work because I didn't have a trailing tab delimiter.
A form to modify this file would make it much more useful
