How can I know macOS command keys in JavaScript.
Need to know left and right command keys. I know key codes of these both but I don't know how to separate from other keys.
You could look on keydown/keyup and record when a key is pressed based on event.keyCode
.
Or as Alexander pointed out, you can also use:
event.metaKey
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/metaKey
There are some libraries which can help you out as these keys are browser dependent
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加