catch-all keyup/keydown events in iframe?

前端 未结 2 1631
野的像风
野的像风 2021-01-12 04:51

I\'m working on a canvas-based game and am using window.addEventListener() to attach keyup and keydown events globally. This works in

2条回答
  •  攒了一身酷
    2021-01-12 05:02

    It seems you can just do var realWindow = window.parent || window; and use addEventListener on realWindow instead.

提交回复
热议问题