📜  响应 keydown 事件监听器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.600000             🧑  作者: Mango

代码示例1
const EscapeListen = React.createClass({
  handleKeyDown: function(e) {
    if (e.keyCode === 27) {
      console.log('You pressed the escape key!')
    }
  },

  render: function() {
    return (
      
    )
  }
})