Caplock mechanism