Mac Carbon |
Author |
Message |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3146 Location: Europe
|
Posted: Fri Apr 06, 2007 5:53 pm Post subject: Events |
|
|
ADC: Processing Events Manually
Code: | OSStatus ReceiveNextEvent(
UInt32 inNumTypes,
const EventTypeSpec *inList,
EventTimeout inTimeout,
Boolean inPullEvent,
EventRef *outEvent
); |
"ReceiveNextEvent runs the low-level event loop, placing events as they
occur into the event queue. The function returns when an event you specified
occurs, or when the specified timeout is exceeded."
ADC: Modal Event States
"If you need to create application-modal dialogs, you can use several
Carbon Event Manager functions to enter and exit the modal state." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3146 Location: Europe
|
Posted: Fri Apr 20, 2007 4:45 pm Post subject: |
|
|
#include <PMCore.h>
#include <PMApplication.h>
#include <PMDefinitions.h>
RunApplicationEventLoop() - Carbon Event Manager Reference
Code: | void RunApplicationEventLoop (void); |
"Note that calling RunApplicationEventLoop also installs the standard
application handler, which provides standard handler responses for menu
and application events."
RunAppModalLoopForWindow() - Carbon Event Manager Reference
Code: | OSStatus RunAppModalLoopForWindow (WindowRef inWindow); |
"This function is used as a replacement for the Dialog Manager function
ModalDialog() to drive a Carbon Event-based modal dialog." To exit out
of it call QuitAppModalLoopForWindow(). |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3146 Location: Europe
|
Posted: Fri Apr 20, 2007 5:23 pm Post subject: |
|
|
ConvertEventRefToEventRecord() - Carbon Event Manager Reference
Code: | Boolean ConvertEventRefToEventRecord (EventRef inEvent, EventRecord *outEvent); |
"Converts an event reference into an event record if the event can be converted. If not, the function returns false and outEvent contains nullEvent.
This function can convert the following events:
• kEventMouseDown, kEventMouseUp, kEventMouseMoved, and kEventMouseDragged (kEventClassMouse)
• kEventRawKeyDown, kEventRawKeyUp, and kEventRawKeyRepeat (kEventClassKeyboard)
• kEventWindowUpdate, kEventWindowActivate, kEventWindowDeactivate, and kEventWindowCursorChange (kEventClassWindow)
• kEventAppActivated and kEventAppDeactivate (kEventClassApplication)
• kEventAppleEvent (kEventClassAppleEvents)
• kEventControlTrack (kEventClassControl) is converted to a mouse down event in Mac OS X v10.4 and later." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri May 04, 2007 9:11 pm Post subject: |
|
|
ADC: WaitNextEvent - Event Manager Reference (Not Recommended)
"The WaitNextEvent function calls the Operating System Event Manager
function SystemEvent to determine whether the event should be handled by
the application or the Operating System.
If no events are pending for your application, WaitNextEvent waits for a
specified amount of time for an event." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat May 26, 2007 1:56 pm Post subject: |
|
|
How to GetNextEvent in XCode
"So I need to write code that will grab the event stream watch for a barcode
then bring FileMaker to the front and type the Cmd-1. What I read about
Carbon and Cocoa is that only events that occur in an apps own windows are
sent to the app." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Jul 19, 2007 11:46 pm Post subject: |
|
|
How to add option-or-control keyboard equivalents?
"The reason why even though SetMenuItemModifiers correctly added
control-or-option-type keyboard equivalents to my menu but they didn't
appear to work is that elsewhere in my code I was using MenuKey()
instead of MenuEvent(). MenuKey is oblivious to the state of the
control, option and shift keys. I switched my code to use MenuEvent(),
and now it works like a charm." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Nov 27, 2007 8:22 pm Post subject: |
|
|
adc - Quartz Event Services Reference
"This document describes the C API for event taps, which are filters used to
observe and alter the stream of low-level user input events in Mac OS X.
Event taps make it possible to monitor and filter input events from several
points within the system, prior to their delivery to a foreground application.
Event taps complement and extend the capabilities of the Carbon event
monitor mechanism, which allows an application to observe input events
delivered to other processes (see the function GetEventMonitorTarget)." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Sun Dec 02, 2007 8:14 pm Post subject: |
|
|
Me and Mark Publishing: Reading the Keyboard with Carbon Events
"An easy and efficient way to support the keyboard is with Carbon events.
This article shows you how to use Carbon events to read the keyboard and
provides an introduction to Carbon events for general application developers."
Me and Mark Publishing: Carbon Event Timers
"This article provides an introduction to Carbon event timers. After reading
the article you will know how to write an event timer, install it, start it, and
stop it." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3146 Location: Europe
|
Posted: Wed May 27, 2009 1:11 pm Post subject: |
|
|
Erik J. Gustafson - MacBook Multitouch
"Here's code to read the raw gesture data from a MacBook trackpad." |
|
Back to top |
|
|
|