1.
Events = Widnow Server 或 Operating System 发送给App 的消息或对象。
2. 事件驱动程序。
3. 事件的来源= 鼠标,键盘 定时器(Timer) 等;
7种事件:
Mouse Event =最常见
KB event = 最常见
Tracking rectangle& cursor update events = 光标超出窗口矩形区域。
Periodic events = 定时
AppKit 定义的事件=窗口变动
系统定义的事件 = 如电源关闭
NSApplication 定义的事件
AppKit framework 的NSEvents.h头文件里定义的事件类型:
typedef enum _NSEventType { /* various types of events */
NSLeftMouseDown = 1,
NSLeftMouseUp = 2,
NSRightMouseDown = 3,
NSRightMouseUp = 4,
NSMouseMoved = 5,
NSLeftMouseDragged = 6,
NSRightMouseDragged = 7,
NSMouseEntered = 8,
NSMouseExited = 9,
NSKeyDown = 10,
NSKeyUp = 11,
NSFlagsChanged = 12,
NSAppKitDefined = 13,
NSSystemDefined = 14,
NSApplicationDefined = 15,
NSPeriodic = 16,
NSCursorUpdate = 17,
NSScrollWheel = 22,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
NSTabletPoint = 23,
NSTabletProximity = 24,
#endif
NSOtherMouseDown = 25,
NSOtherMouseUp = 26,
NSOtherMouseDragged = 27
} NSEventType;
Events = Widnow Server 或 Operating System 发送给App 的消息或对象。
2. 事件驱动程序。
3. 事件的来源= 鼠标,键盘 定时器(Timer) 等;
7种事件:
Mouse Event =最常见
KB event = 最常见
Tracking rectangle& cursor update events = 光标超出窗口矩形区域。
Periodic events = 定时
AppKit 定义的事件=窗口变动
系统定义的事件 = 如电源关闭
NSApplication 定义的事件
AppKit framework 的NSEvents.h头文件里定义的事件类型:
typedef enum _NSEventType { /* various types of events */
NSLeftMouseDown = 1,
NSLeftMouseUp = 2,
NSRightMouseDown = 3,
NSRightMouseUp = 4,
NSMouseMoved = 5,
NSLeftMouseDragged = 6,
NSRightMouseDragged = 7,
NSMouseEntered = 8,
NSMouseExited = 9,
NSKeyDown = 10,
NSKeyUp = 11,
NSFlagsChanged = 12,
NSAppKitDefined = 13,
NSSystemDefined = 14,
NSApplicationDefined = 15,
NSPeriodic = 16,
NSCursorUpdate = 17,
NSScrollWheel = 22,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
NSTabletPoint = 23,
NSTabletProximity = 24,
#endif
NSOtherMouseDown = 25,
NSOtherMouseUp = 26,
NSOtherMouseDragged = 27
} NSEventType;