自分のアプリケーション以外でのイベント発火を監視するとき,NSEvent.addGlobalMonitorForEvents()
を使うと思います.
そこで,最近気付いたのですが,NSEvent.EventTypeMask.flagsChanged
は何もしなくても呼ばれるのに,NSEvent.EventTypeMask.keyDown
は[環境設定]->[セキュリティーとプライバシー]->[アクセシビリティ]をいじらないと呼ばれないんですねぇ.
これはパスワードなどのハッキングを防ぐためだと思われます.はぇぇ...
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme