You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GPUI currently supports a subset of available platform events. The macOS implementation shows that while cocoa-rs provides many more event types, GPUI only handles a limited set. This limitation prevents developers from implementing features that rely on platform-specific gestures and inputs, such as pinch-to-zoom for infinite canvas applications.
Current State
The current PlatformInput::from_native implementation on macOS handles:
Mouse events (down, up, move, drag, exit)
Keyboard events (down, up, flags changed)
Scroll wheel events
Limited swipe events (only for navigation)
However, cocoa-rs exposes many more event types that are currently ignored:
NSMouseEntered (8)
NSCursorUpdate (17)
NSTabletPoint (23)
NSTabletProximity (24)
NSEventTypeGesture (29)
NSEventTypeMagnify (30)
NSEventTypeRotate (18)
NSEventTypeBeginGesture (19)
NSEventTypeEndGesture (20)
NSEventTypePressure (34)
Use Cases
Infinite Canvas Applications: Pinch-to-zoom (magnify) and rotate gestures are essential for canvas manipulation
Drawing Applications: Tablet pressure events for pressure-sensitive drawing
Advanced UI Interactions: Mouse enter events for hover states, cursor updates for custom cursors
Creative Tools: Rotate gestures for object manipulation
Implementation Priority
High priority events (most commonly needed):
NSEventTypeMagnify - Essential for zoom functionality
NSMouseEntered - Common UI pattern
NSEventTypeRotate - Useful for canvas/object manipulation
Medium priority:
NSEventTypeBeginGesture/NSEventTypeEndGesture - For gesture state management
NSCursorUpdate - For custom cursor support
Lower priority:
NSTabletPoint/NSTabletProximity/NSEventTypePressure - Specialized for drawing tablets
Platform Considerations
macOS: Full support available through cocoa-rs
Windows: Need to map to equivalent WM_GESTURE messages
Linux: Support varies by compositor; may need feature detection
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
GPUI currently supports a subset of available platform events. The macOS implementation shows that while cocoa-rs provides many more event types, GPUI only handles a limited set. This limitation prevents developers from implementing features that rely on platform-specific gestures and inputs, such as pinch-to-zoom for infinite canvas applications.
Current State
The current
PlatformInput::from_native
implementation on macOS handles:However, cocoa-rs exposes many more event types that are currently ignored:
NSMouseEntered
(8)NSCursorUpdate
(17)NSTabletPoint
(23)NSTabletProximity
(24)NSEventTypeGesture
(29)NSEventTypeMagnify
(30)NSEventTypeRotate
(18)NSEventTypeBeginGesture
(19)NSEventTypeEndGesture
(20)NSEventTypePressure
(34)Use Cases
Implementation Priority
High priority events (most commonly needed):
NSEventTypeMagnify
- Essential for zoom functionalityNSMouseEntered
- Common UI patternNSEventTypeRotate
- Useful for canvas/object manipulationMedium priority:
NSEventTypeBeginGesture
/NSEventTypeEndGesture
- For gesture state managementNSCursorUpdate
- For custom cursor supportLower priority:
NSTabletPoint
/NSTabletProximity
/NSEventTypePressure
- Specialized for drawing tabletsPlatform Considerations
Beta Was this translation helpful? Give feedback.
All reactions