-
Notifications
You must be signed in to change notification settings - Fork 621
Open
Labels
area/SkiaSharpIssues that relate to the C# binding of SkiaSharp.Issues that relate to the C# binding of SkiaSharp.type/enhancement
Description
Overview
Add scroll wheel support to SkiaSharp's Tizen MAUI views by handling Wheel events in the Tizen SKTouchHandler, normalized to the v120 standard (120 = one discrete mouse wheel notch).
Parent issue: #3533
Current State
The Tizen SKTouchHandler (source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Platform/Tizen/SKTouchHandler.cs) currently:
- Handles:
TouchEventwithPointStateType(Down, Up, Motion, Leave, Interrupted) - Does NOT handle:
WheelEvent - Has no wheel delta support
Platform Details
Native API
Tizen.NUI.Wheel class:
// Wheel event properties:
public WheelType Type { get; } // MouseWheel or CustomWheel
public int Direction { get; } // 0 = vertical, 1 = horizontal
public uint Modifiers { get; } // Alt, Shift, Ctrl bitmask
public int Z { get; } // Scroll delta (ticks)
public uint TimeStamp { get; }
public Vector2 Point { get; } // Cursor positionRaw Values Per Discrete Mouse Notch
| Device | Z value | Notes |
|---|---|---|
| Standard mouse wheel | ±1 | One tick per notch |
| Fast scroll | ±1 per event | Multiple rapid events |
Sign Convention
Z > 0= rolling down / clockwiseZ < 0= rolling up / counter-clockwise- Must negate — opposite of v120 convention (where positive = up)
Official Documentation
- Tizen.NUI.Wheel class (API reference) — API reference with Z, Direction, Type properties
- TizenFX Wheel.cs source code — implementation source
- Dali::WheelEvent (native API) — underlying native wheel event struct with
directionandzfields - Tizen.NUI.BaseComponents.View — base class that provides
WheelEventhandler
Note: The Tizen NUI CustomView guide covers class derivation, visuals, and gestures but does not cover wheel event handling. For wheel semantics, refer to the
Wheelclass API reference andDali::WheelEventnative docs linked above.
Normalization Logic
// In wheel event handler:
int wheelDelta = -wheel.Z * 120;
// Negate: Tizen positive = down, v120 positive = up
// Scale: 1 tick × 120 = 120
//
// Mouse notch down (Z=1) → -120
// Mouse notch up (Z=-1) → 120Expected Results
| Input | Calculation | WheelDelta |
|---|---|---|
| Mouse notch up (Z=-1) | -(-1) × 120 |
120 |
| Mouse notch down (Z=1) | -(1) × 120 |
-120 |
| Two notches up (Z=-2) | -(-2) × 120 |
240 |
Implementation Notes
- Register a
WheelEventhandler on the NUI View (alongside existingTouchEvent) - Fire
SKTouchAction.WheelChangedwithSKTouchDeviceType.Mouse - Use
wheel.Pointfor cursor position (convert to view coordinates as needed) - Set
inContact = false - Check
wheel.Direction— 0 = vertical (useZ), 1 = horizontal (future enhancement) - Feed
args.Handledback to the event system - Reference: Windows handler in
Platform/Windows/SKTouchHandler.csfor the pattern
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/SkiaSharpIssues that relate to the C# binding of SkiaSharp.Issues that relate to the C# binding of SkiaSharp.type/enhancement
Type
Projects
Status
New