搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Capture the shift key when pressed

  • 1 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 codyb29

more options

I am writing a program that requires me to detect when a shift key is pressed and do something. Something like

window.addEventListener('keydown', event => console.log(event), false); // expect to see an event logged to console when pushing the "shift" key

This works great on all browsers except Firefox. "alt" and "fn" keys are also not able to be detected on Firefox. Is there some sort of advanced security settings I can disable to let me capture these things?

Thanks in advance.

I am writing a program that requires me to detect when a shift key is pressed and do something. Something like window.addEventListener('keydown', event => console.log(event), false); // expect to see an event logged to console when pushing the "shift" key This works great on all browsers except Firefox. "alt" and "fn" keys are also not able to be detected on Firefox. Is there some sort of advanced security settings I can disable to let me capture these things? Thanks in advance.

所有回复 (1)

more options

This is actually working on Windows. This could be a mac OS issue.