addEventListener for keydown on Canvas

后端 未结 4 1843
忘了有多久
忘了有多久 2020-11-28 06:51

I am trying to make a canvas app that responds to keyboard and mouse input. I have this code:

canvas = document.getElementById(\'canvas\');
canvas.addEventLi         


        
4条回答
  •  温柔的废话
    2020-11-28 07:20

    Set the tabindex of the canvas element to 1 or something like this

    
    

    It's an old trick to make any element focusable

提交回复
热议问题