Great painting ... and great gun, Michl. Thank you so much for sharing.
Unfortunately i am far from being able to figure out the difference between the various versions (and subversions) of the patilla (so called Miquelet) lock. What appears obvious to connoisseurs looks too subtle for a layman. To put it even cruder, the differences between such variations are sometimes more observable by the inside than properly looking at the lock exterior, as in the case of the agujetas function; pardon me if i am talking nonsense ... i am brave enough to do it

.
I have paged Lavin's work and also some Portuguese publications. Having tried to find the translation or correspondence for the Agujeta version, i was told this is a sole Spanish lock system or, at least, there is no Portuguese counterpart for it, so the name applied here is the Spanish term.
This would take us to infer that, when Lavin says (page 172-Fig. 19) that the Sinhalese agujeta lock was probaly introduced there by the Portuguese prior to 1658, this system wasn't necessarily invented by the Portuguese but merely brought there, which wouldn't constitute any surprise as, Lavin himself reminds us in page 181, Portugal was a Spanish dominium between 1580-1640.
... This not meaning that Portuguese did not introduce in that period some of their own systems in Ceylon, namely the Anselmo lock with one position, with and without dog catch (back sear). Michl not minding, i show here an excelent specimen of such anselmo lock, made in Ceylon in the XVII century , signed D. TRELY.
.