pkamb / PowerKey

Remap your Macbook's power key to Forward Delete
MIT License
229 stars 29 forks source link

Bug in event monitoring #73

Open derpmacos opened 5 years ago

derpmacos commented 5 years ago

PKPowerKeyEventListener.m - (void)monitorPowerKey { ..

bug: NSEventTypeSystemDefined is not a mask. Instead use CGEventMask eventTypeMask = NX_SYSDEFINEDMASK and skip the loop adding masks for other event types.

suggestion: CGEventTapCreate(...) would be better configured with kCGEventTapOptionListenOnly since it doesn't seem to be possible to block the power events.

pkamb commented 5 years ago

Is there a user-visible bug you are seeing?

I will look into that NX_SYSDEFINEDMASK; can't remember if we have tried to use that in the past.

Previous discussion about the event mask: https://github.com/pkamb/PowerKey/pull/5