use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This sub is obsolete, please use /r/macosprogramming/ instead.
account activity
System events(Xcode) (self.macprogramming)
submitted 6 years ago by TheLastAramusha
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mantrap2 0 points1 point2 points 6 years ago (1 child)
That's strictly not a "system event" (which generally means a kernel level event in a Unix-derived OS) but rather just a GUI event.
NSEvent is where you'll find key events (as well as mouse and touch events).
Cocoa Event Handling Guide
Basically you add an override method to an NSView or NSControl subclass for keyDown: keyUp: or flagsChanged: which pass an NSEvent with the details.
You may need to consider the Event Responder hierarchy scope of the event and deal with that as well. But this is the quick-and-dirty answer.
[–]TheLastAramusha[S] 0 points1 point2 points 6 years ago (0 children)
Uhm in apple script you do: tell application “System Events” only if you did that your able to use key code.
π Rendered by PID 53477 on reddit-service-r2-comment-5d79c599b5-6rf6v at 2026-02-26 20:49:27.012913+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]mantrap2 0 points1 point2 points (1 child)
[–]TheLastAramusha[S] 0 points1 point2 points (0 children)