2

I can check the NSScrollWheel event from a mouse or a trackpad:

Mac Cocoa: How to differentiate if a NSScrollWheel event is from a mouse or trackpad?

But it is possible to check a mouse click, also a NSEvent is from a mouse or trackpad? Thanks.

Community
  • 1
  • 1
DNB5brims
  • 29,344
  • 50
  • 131
  • 195

1 Answers1

0

You should be able to check "event.subtype" to see from which device it came.

If it's a mouse, the "subtype" value should be NSMouseEventSubtype. If it's not a mouse, the value will be something else (e.g.: NSApplicationActivatedEventType or NSTouchEventSubtype).

original_username
  • 2,398
  • 20
  • 24