jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.66k stars 410 forks source link

How I only set (command+r on mac) and (ctrl+r on mac)? #390

Closed liu-xinhui closed 2 years ago

liu-xinhui commented 2 years ago
hotkeys('ctrl+r, command+r', function() {
  alert('stopped reload!');
  return false;
});

If I use this, ctrl+r, command+r are all trigged on mac. I only want command+r

xlboy commented 2 years ago

Doesn't seem to support. You may be looking for something similar to the mod assistant in the mousetrap library.

Or you can manually determine the MacOS/Windows platform to register hotkeys

liu-xinhui commented 2 years ago

@xlboy thank you