Skip to content

Add new scenarios to Input sample (PointerTracking, PointerPointProperties, DeviceCapabilities, XamlManipulations) - #650

Open
shisan (qiutongMS) wants to merge 4 commits into
mainfrom
user/qiutongshen/add-input-scenarios
Open

shisan (qiutongMS) wants to merge 4 commits into
mainfrom
user/qiutongshen/add-input-scenarios

Conversation

@qiutongMS

@qiutongMS shisan (qiutongMS) commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 4 new scenario pages to the existing Input sample, migrated from
Windows-universal-samples/BasicInput
and
windows-topic-specific-samples
(branches uwp-pointers + uwp-pointers-animation).

These scenarios are referenced by multiple pages under
learn.microsoft.com/windows/apps/develop/input/.

New Scenarios

# Scenario Source Description
5 Pointer Tracking uwp-pointers + uwp-pointers-animation Tracks multiple pointers in real time, highlights the current primary pointer, and displays pointer counts and events
6 Pointer Point Properties BasicInput Displays pointer properties on press - mouse buttons (red), pen pressure/barrel (yellow), touch contact rect (green)
7 Device Capabilities BasicInput Shows keyboard, mouse, and touch device capabilities using KeyboardCapabilities, MouseCapabilities, TouchCapabilities
8 XAML Manipulations BasicInput Demonstrates ManipulationMode with configurable translate axis (X/Y/both), rotation, and inertia toggle

Doc pages that reference these scenarios

Notable details

  • Pointer Tracking combines pointer tracking and primary-pointer animation into
    one scenario.
  • Pointer Point Properties adds Background="Transparent" on its Canvas so
    pointer hit testing works in WinUI 3.
  • Adds Assets\Landscape.jpg to the Content items because it is required by
    the Gesture Recognizer Manipulations scenario.

Testing

  • Rebased onto the current main branch while retaining the existing Keyboard
    Shortcut Manager scenario.
  • Built the Input solution for x64 Release with no warnings or errors.
  • All scenarios were previously verified on Windows 11 with mouse and touch
    input in packaged mode.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Input (cs-winui) sample by adding new scenario pages demonstrating pointer tracking, pointer point properties, device capability detection, and XAML manipulation interactions, aligning the sample with scenarios referenced by Microsoft Learn input documentation.

Changes:

  • Added new scenario pages: PointerTracking, Pointer Point Properties, Device Capabilities, and XAML Manipulations, plus a shared PointerEllipse control.
  • Updated scenario registration so the new pages appear in the sample’s navigation list.
  • Updated the project to include required content/assets and ensured new XAML pages are compiled.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Samples/Input/cs-winui/XamlManipulations.xaml.cs Adds code-behind for manipulation transforms, options, and reset behavior.
Samples/Input/cs-winui/XamlManipulations.xaml Adds UI for manipulation scenario (axis selection, inertia toggle, reset, target element).
Samples/Input/cs-winui/SampleConfiguration.cs Registers the new scenarios in the app’s scenario list.
Samples/Input/cs-winui/Properties/launchSettings.json Reorders/normalizes debug profiles for packaged vs unpackaged runs.
Samples/Input/cs-winui/PointerTracking.xaml.cs Implements multi-pointer tracking logic and UI updates.
Samples/Input/cs-winui/PointerTracking.xaml Defines UI for pointer tracking canvas and status readouts.
Samples/Input/cs-winui/PointerPointProperties.xaml.cs Implements pointer property popups and device-specific property rendering.
Samples/Input/cs-winui/PointerPointProperties.xaml Defines UI surface for pointer property display interactions.
Samples/Input/cs-winui/PointerEllipse.xaml.cs Adds a reusable pointer visualization control with primary/secondary styling.
Samples/Input/cs-winui/PointerEllipse.xaml Defines the animated ellipse storyboard and visuals for pointer feedback.
Samples/Input/cs-winui/Input.csproj Includes new pages/assets (including Landscape.jpg) and ensures new XAML pages compile.
Samples/Input/cs-winui/DeviceCapabilities.xaml.cs Implements device capability reporting using Keyboard/Mouse/TouchCapabilities.
Samples/Input/cs-winui/DeviceCapabilities.xaml Defines UI for displaying capability results and scenario description.

Comment thread Samples/Input/cs-winui/XamlManipulations.xaml.cs Outdated
Comment thread Samples/Input/cs-winui/PointerTracking.xaml.cs Outdated
Comment thread Samples/Input/cs-winui/PointerPointProperties.xaml.cs Outdated
Comment thread Samples/Input/cs-winui/PointerEllipse.xaml.cs Outdated
Comment thread Samples/Input/cs-winui/DeviceCapabilities.xaml.cs Outdated
Comment thread Samples/Input/cs-winui/XamlManipulations.xaml.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Comment thread Samples/Input/cs-winui/PointerTracking.xaml.cs
Comment thread Samples/Input/cs-winui/PointerEllipse.xaml.cs
Comment thread Samples/Input/cs-winui/PointerPointProperties.xaml.cs
Comment thread Samples/Input/cs-winui/PointerPointProperties.xaml Outdated
Comment thread Samples/Input/cs-winui/XamlManipulations.xaml Outdated
Comment thread Samples/Input/cs-winui/SampleConfiguration.cs Outdated
Qiutong Shen and others added 3 commits September 16, 2026 13:35
Migrated from windows-topic-specific-samples (uwp-pointers + uwp-pointers-animation).
- Multi-pointer tracking with Canvas visualization
- Primary pointer detection with animated Ellipse (Storyboard)
- Handles all pointer lifecycle events

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… scenarios

- PointerPointProperties: shows pointer info (mouse buttons, pen pressure, touch contact rect) on click/touch with color-coded display
- DeviceCapabilities: displays keyboard, mouse, and touch device capabilities
- XamlManipulations: demonstrates ManipulationMode with translate, rotate, and inertia controls
- Fix Canvas Background='Transparent' for hit-test in PointerPointProperties
- Add Landscape.jpg to Content items for GestureRecognizerManipulation scenario
- Reorder launchSettings.json to default to Unpackaged profile

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add UTF-8 BOM to all new .cs files per .editorconfig requirement
- Replace XOR toggle with explicit set/clear for inertia ManipulationMode flags

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qiutongMS
shisan (qiutongMS) force-pushed the user/qiutongshen/add-input-scenarios branch from 2a6c407 to a9aa233 Compare September 16, 2026 05:36
@qiutongMS
shisan (qiutongMS) changed the base branch from release/experimental to main September 16, 2026 05:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants