Skip to content

Add wheel support to Tizen MAUI views with v120 normalization #3538

@mattleibow

Description

@mattleibow

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: TouchEvent with PointStateType (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 position

Raw 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 / clockwise
  • Z < 0 = rolling up / counter-clockwise
  • Must negate — opposite of v120 convention (where positive = up)

Official Documentation

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 Wheel class API reference and Dali::WheelEvent native 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) → 120

Expected 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 WheelEvent handler on the NUI View (alongside existing TouchEvent)
  • Fire SKTouchAction.WheelChanged with SKTouchDeviceType.Mouse
  • Use wheel.Point for cursor position (convert to view coordinates as needed)
  • Set inContact = false
  • Check wheel.Direction — 0 = vertical (use Z), 1 = horizontal (future enhancement)
  • Feed args.Handled back to the event system
  • Reference: Windows handler in Platform/Windows/SKTouchHandler.cs for the pattern

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions