Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Packaging of Tablet Events

Tablet device drivers package low-level events as either native tablet events or as mouse events, usually depending on whether they are proximity events or pointer events. Proximity events are always native tablet events. The Application Kit declares (in NSEvent.h) the following event-type constants for native tablet events:

typedef enum _NSEventType {
    // ...
    NSTabletPoint     = 23,
    NSTabletProximity = 24,
    // ...
} NSEventType;

Drivers almost always package tablet-pointer events as subtypes of mouse events. The Application Kit declares the following constants for tablet subtypes of all event types related to mouse event (NSLeftMouseDown, NSRightMouseUp, NSMouseMoved, and so on):

enum {
    NSMouseEventSubtype           = NX_SUBTYPE_DEFAULT,
    NSTabletPointEventSubtype      = NX_SUBTYPE_TABLET_POINT,
    NSTabletProximityEventSubtype = NX_SUBTYPE_TABLET_PROXIMITY
};

Under a few exceptional conditions drivers may package a low-level tablet-pointer event as a NSTabletPoint event type instead of a mouse-event subtype. These include the following:

For this reason, it is recommended that your code check for tablet-pointer events delivered both as native event types and as mouse subtypes.



< Previous PageNext Page > Hide TOC


Last updated: 2007-03-16




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice