An idiom, generally used when referring to teachers, describes when a person looks extremely mad at someone else or yourself, and they (in their head) "click a pen", ready to write someone up, or explode on the offender later.
Did you see the way Mr. Rogers was looking at me? He totally just clicked a pen in his head.