confusing
Can anyone clarify how the castling codes work

Kk = King landing spot when short castling
Kq = King landing spot when long castling
kRk = kingside Rook landing spot when short castling
qRq = queenside Rook landing spot when long castling

Kk = King landing spot when short castling
Kq = King landing spot when long castling
kRk = kingside Rook landing spot when short castling
qRq = queenside Rook landing spot when long castling
Thanks

If you think about it, it's quite simple:
The 2 Ks in kk signify the King moving and which direction it's castling, also known as Kingside
The Q in kq mean Queenside castling
The R in kRk and qRq means the Rook movement

I think you're missing the crux of the matter. The k4 and e4 are based on the 14x14 coordinates grid. For example in XXL chess:
Kk':'m1','Kq':'c1','kRk':'l1','qRq':'d1
Therefore. The k4 and e4 are out of line so they have to be adjusted based on the grid.
It's not difficult but it's all based on 14x14 coordinates grid.
Castling string for 10x8 Gothic Chess. It seems very confusing to the uninitiated.