Skip to content

Keyboard events sample in winui3 - #383

Merged
Ajit Surana (AjitSurana) merged 5 commits into
microsoft:mainfrom
SreejaBhattacharya-MSFT:user/srbhatta/KeyboardEventsSample
Sep 16, 2024
Merged

Ajit Surana (AjitSurana) merged 5 commits into
microsoft:mainfrom
SreejaBhattacharya-MSFT:user/srbhatta/KeyboardEventsSample

Conversation

@SreejaBhattacharya-MSFT

@SreejaBhattacharya-MSFT SreejaBhattacharya-MSFT (SreejaBhattacharya-MSFT) commented Sep 3, 2024 •

Copy link
Copy Markdown
Contributor

Description

This PR contains a sample that showcases the implementation of the below keyboard events in WinUI3 Windows App SDK sample app. It consists of both cs and cpp samples.

  • KeyUp
  • KeyDown
  • CharacterReceived
  • KeyboardAccelerators

Checklist

  • Samples build and run using the Visual Studio versions listed in the Windows development docs.
  • Samples build and run on all supported platforms (x64, x86, ARM64) and configurations (Debug, Release).
  • Samples set the minimum supported OS version to Windows 10 version 1809.
  • Samples build clean with no warnings or errors.
  • [For new samples]: Samples have completed the sample guidelines checklist and follow standardization/naming guidelines.
  • I have commented on my PR /azp run SamplesCI-<FeatureName> to have the CI build run on my branch for each of my FeatureName my PR is modifying. This must be done on the latest commit on the PR before merging to ensure the build is up to date and accurate. Warning: the PR will not block automatically if this is not run due to '/azp run' limitation on triggering more than 10 pipelines.

@SreejaBhattacharya-MSFT
SreejaBhattacharya-MSFT (SreejaBhattacharya-MSFT) marked this pull request as ready for review September 3, 2024 13:59
@Saharsh979

Copy link
Copy Markdown
Collaborator

Windows App SDK samples are integrated with the docs samples browser. All feature samples should include metadata in the sample README to integrate with the docs sample browser.

For reference:
https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/Widgets
https://github.com/microsoft/WindowsAppSDK-Samples/blob/main/Samples/Islands/README.md

@Saharsh979

Copy link
Copy Markdown
Collaborator

The guidelines recommend having samples for both C# and C++ at a minimum.

On a side note - There is not a hard requirement to cover all the other combinations (e.g. having all UI frameworks, having both Unpackaged and Packaged samples). However, if there is something unique about the specific component, the samples should highlight and showcase these scenarios.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add the appropriate copyright notice and license text to the headers.

For C#/C++ files (*h, *.cpp, *.cs, *.idl):

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

For XAML files (*.xaml):

<!-- Copyright (c) Microsoft Corporation.
 Licensed under the MIT License. -->

@SreejaBhattacharya-MSFT

Copy link
Copy Markdown
Contributor Author

/azp run SamplesCI-Input

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 383 in repo microsoft/WindowsAppSDK-Samples

@Saharsh979

Copy link
Copy Markdown
Collaborator

/azp run SamplesCI-Input

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

jeffstall

This comment was marked as duplicate.

@jeffstall Jeffrey Stall (jeffstall) 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.

Can you remove the C++ version of the sample? It offers no clear value, and it just requires more maintenance.

Please also clean up the C# changes to clarify this is showing WinUI-specific keyboard handling, not generic WinAppSDK keyboard handling.

Comment thread Samples/Input/cs-winui/README.md Resolved

@jeffstall Jeffrey Stall (jeffstall) 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.

Thanks for making these changes!

@Saharsh979

Copy link
Copy Markdown
Collaborator

Has this step about "Onboarding Samples CI Pipeline for new feature" mentioned in the docs been taken care of?
I can see the .yml file is already present. SamplesCI-Input.yml
Kindly check if there are any pipeline changes required for this as well.

@AjitSurana
Ajit Surana (AjitSurana) merged commit 9ffb709 into microsoft:main Sep 16, 2024
shisan (qiutongMS) pushed a commit that referenced this pull request Aug 25, 2026
Port the stable keyboard event and accelerator scenario from main PR #383 while retaining the release project configuration and central package management.

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.

4 participants