5

Is there any way to capture global key presses (even when my application isn't active) in Mac OS using Swift?

Thanks in advance.

FrozenHeart
  • 19,844
  • 33
  • 126
  • 242

1 Answers1

2

Yes, you can use NSEvent to add a global event monitor. Checkout this Swift 3 example here: https://stackoverflow.com/a/40509620/1791525

Community
  • 1
  • 1
Daniel Sposito
  • 448
  • 1
  • 4
  • 13