Skip to content

Commit 01d9080

Browse files
committed
Renaming article to 'Handle Microsoft Copilot hardware key state changes', removing PressAndHoldAndRelease references, and de-emphasizing audio recording scenario.
1 parent 07ebc58 commit 01d9080

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

hub/apps/develop/windows-integration/copilot-pressandholdandrelease.md renamed to hub/apps/develop/windows-integration/copilot-key-state.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Microsoft Copilot hardware key PressAndHoldAndRelease
2+
title: Handle Microsoft Copilot hardware key state changes
33
description: Learn how to register to be activated and receive notifications when the Microsoft Copilot hardware key or Windows + C is pressed.
44
ms.topic: article
55
ms.date: 10/25/2024
@@ -8,15 +8,9 @@ ms.localizationpriority: medium
88

99

1010

11-
# Microsoft Copilot hardware key PressAndHoldAndRelease
11+
# Handle Microsoft Copilot hardware key state changes
1212

13-
This article describes how apps can register to be activated and receive notifications when the Microsoft Copilot hardware key or Windows + C is pressed. This feature enables the following user scenario.
14-
15-
1. The user presses the Microsoft Copilot Hardware key or Windows + C and holds it for the system-defined 700 ms time window.
16-
1. The system launches the Copilot Key provider app, letting the app know that the user is pressing and holding the key.
17-
1. The app begins recording audio and shows a window indicating to the user that audio is being recorded.
18-
1. The user speaks and then releases the key.
19-
1. The app is notified that the key has been released, prompting it to process the recorded speech and taking additional actions based on the user's words.
13+
This article describes how apps can register to be activated and receive notifications when the Microsoft Copilot hardware key or Windows + C is pressed, pressed and held, and released. This feature enables apps to perform different actions depending on which key state change is detected. For example, and app may perform normal activation when the key is single-pressed, but record audio or take a screenshot when the key is pressed and held..
2014

2115
This feature extends the features of a basic Microsoft Copilot hardware key provider, which simply registers to be launched when the hardware key is pressed. For more information, see [Microsoft Copilot hardware key providers](microsoft-copliot-key-provider.md).
2216

@@ -83,7 +77,7 @@ public MainWindow(string state)
8377

8478
## Register for URI activation
8579

86-
The system launches Microsoft Copilot hardware key providers that implement PressAndHoldAndRelease using URI activation. Register a launch protocol by adding the [uap:Protocol](/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol) element to your app manifest. For more information about how to register as the default handler for a URI scheme, see [Handle URI activation](/windows/apps/develop/launch/handle-uri-activation).
80+
The system launches Microsoft Copilot hardware key providers using URI activation. Register a launch protocol by adding the [uap:Protocol](/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol) element to your app manifest. For more information about how to register as the default handler for a URI scheme, see [Handle URI activation](/windows/apps/develop/launch/handle-uri-activation).
8781

8882
The following example shows the **uap:Extension** registering the URI scheme "myapp-copilothotkey".
8983

@@ -105,7 +99,7 @@ The following example shows the **uap:Extension** registering the URI scheme "my
10599

106100
## Microsoft Copilot hardware key app extension
107101

108-
An app must be packaged in order to register as a Microsoft Copilot hardware key provider. For information on app packaging, see [An overview of Package Identity in Windows app](/windows/apps/desktop/modernize/package-identity-overview). Microsoft Copilot hardware key providers declare their registration information within the [uap3:AppExtension](/uwp/schemas/appxpackage/uapmanifestschema/element-uap3-appextension-manual). The **Name** attribute of the extension must be set to "com.microsoft.windows.copilotkeyprovider". To support the PressAndHoldAndRelease feature, apps must provide some additional entries to their **uap3:AppExtension** declaration.
102+
An app must be packaged in order to register as a Microsoft Copilot hardware key provider. For information on app packaging, see [An overview of Package Identity in Windows app](/windows/apps/desktop/modernize/package-identity-overview). Microsoft Copilot hardware key providers declare their registration information within the [uap3:AppExtension](/uwp/schemas/appxpackage/uapmanifestschema/element-uap3-appextension-manual). The **Name** attribute of the extension must be set to "com.microsoft.windows.copilotkeyprovider". To support the key state changes, apps must provide some additional entries to their **uap3:AppExtension** declaration.
109103

110104
Inside of the **uap3:AppExtension** element, add a [uap3:Properties](/uwp/schemas/appxpackage/uapmanifestschema/element-uap3-properties-manual) element with child elements **PressAndHoldStart** and **PressAndHoldStart**. The contents of these elements should be the URI of the protocol scheme registered in the manifest in the previous step. The query string arguments specify whether the URI is being launched because the user pressed and held the hot key or because the user released the hot key. The app uses these query string values during app activation to determine the correct action to take.
111105

@@ -268,18 +262,3 @@ private LRESULT WindowSubClass(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lPara
268262
}
269263
```
270264

271-
## Next steps
272-
273-
This example shown in this walkthrough only demonstrates handling activation based on a change in the Windows Copilot hardware key pressed state. Since the purpose of the PressAndHoldAndRelease is to provide a voice chat-style interface, your app needs to implement some more sophisticated behavior.
274-
275-
### Recording audio
276-
277-
Apps will typically begin recording audio when the button state changes to *PressAndHoldStart* and stop recording when the state changes to *PressAndHoldEnd*. For information about recording audio in a Windows app, see [Basic photo, video, and audio capture with MediaCapture in a WinUI 3 app](/windows/apps/develop/camera/basic-photo-capture) or [Audio/Video Capture in Media Foundation](/windows/win32/medfound/audio-video-capture-in-media-foundation).
278-
279-
### Processing speech
280-
281-
To determine the user intent from the recorded audio, apps may need to use a speech to text processing. There are many ways to do this from a Windows app, including using local AI models or using a web service such as [Azure AI Speech service](/azure/ai-services/speech-service). For more information, see [Speech to text documentation](/azure/ai-services/speech-service/index-speech-to-text).
282-
283-
### Status UI
284-
285-
**TBD - I'm not sure of the requirements around UI for PressAndHoldAndRelease. It would be nice to provide some UI guidance and/or link to docs for the best practices for the relevant UI features (e.g. showing and hiding a window)**

hub/apps/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ items:
357357
- name: Microsoft Copilot hardware key providers
358358
href: develop/windows-integration/microsoft-copliot-key-provider.md
359359
items:
360-
- name: Microsoft Copilot hardware key PressAndHoldAndRelease
361-
href: develop/windows-integration/copilot-pressandholdandrelease.md
360+
- name: Handle Microsoft Copilot hardware key state changes
361+
href: develop/windows-integration/copilot-key-state.md
362362
- name: Search providers
363363
items:
364364
- name: Overview

0 commit comments

Comments
 (0)