Locking devices applied to printing mechanisms