Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
| Line 51: | Line 51: | ||
In the Cocoa event model, NPP_HandleEvent now passes a new struct, NPCocoaEvent, which is shown below: | In the Cocoa event model, NPP_HandleEvent now passes a new struct, NPCocoaEvent, which is shown below: | ||
typedef struct _NPCocoaEvent { | typedef struct _NPCocoaEvent { | ||
NPCocoaEventType type; | |||
union { | |||
struct { | |||
uint32 modifierFlags; | |||
double pluginX; | |||
double pluginY; | |||
int32 buttonNumber; | |||
int32 clickCount; | |||
double deltaX; | |||
double deltaY; | |||
double deltaZ; | |||
} mouse; | |||
struct { | |||
uint32 modifierFlags; | |||
NPNSString *characters; | |||
NPNSString *charactersIgnoringModifiers; | |||
NPBool isARepeat; | |||
uint16 keyCode; | uint16 keyCode; | ||
} key; | |||
struct { | |||
double x, y, width, height; | |||
} draw; | |||
struct { | |||
NPBool hasFocus; | |||
} focus; | |||
} event; | |||
} NPCocoaEvent; | } NPCocoaEvent; | ||
NPCocoaEventType is one of the following: | NPCocoaEventType is one of the following: | ||