Javascript/jQuery Keypress logging

前端 未结 7 1768
日久生厌
日久生厌 2020-12-30 14:34

I would like to be able to log the key presses on a specific page, trying to implement an \'Easter egg\' type functionality where when the correct keys are pressed in the co

7条回答
  •  情书的邮戳
    2020-12-30 14:40

    I'm not sure of the exact keypress codes, I borrowed from Hans Kov's answer. I would use an array like a stack and just push a new keypress onto the stack, then pop them off to check for correct order.

    
    
                                     
                  
提交回复
热议问题