Udostępnij za pośrednictwem


HumanPresenceSensor Class

Definition

Represents a sensor that detects whether a user is present, absent, or not interacting with their device.

public ref class HumanPresenceSensor sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 983040)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HumanPresenceSensor final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 983040)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HumanPresenceSensor
Public NotInheritable Class HumanPresenceSensor
Inheritance
Object Platform::Object IInspectable HumanPresenceSensor
Attributes

Windows requirements

Device family
Windows 11 Insider Preview (introduced in 10.0.23504.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v15.0)

Remarks

Presence detection can have a significant impact on security, responsiveness, and performance.

  • Devices can be locked automatically when left unattended to protect sensitive files and other info.
  • User intent can be inferred to reduce the response time required from detection to authentication or interaction.
  • Battery life can be preserved by reducing unnecessary screen idle time.

Properties

DeviceId

Gets the unique device ID of the human presence sensor.

IsEngagementSupported

Gets whether the human presence sensor is capable of perceiving if the user is engaged with (looking at) their PC.

IsPresenceSupported

Gets whether the human presence sensor is capable of perceiving if the user is in front of their PC.

MaxDetectableAltitudeInDegrees

Gets the maximum altitude angle supported by the human presence sensor, in degrees.

MaxDetectableAzimuthInDegrees

Gets the maximum azimuth angle supported by the human presence sensor, in degrees.

MaxDetectableDistanceInMillimeters

Gets the maximum distance the human presence sensor can detect a user.

MaxDetectablePersons

Gets the maximum number of people that can be detected by the human presence sensor.

MinDetectableAltitudeInDegrees

Gets the minimum altitude angle supported by the human presence sensor, in degrees.

MinDetectableAzimuthInDegrees

Gets the minimum azimuth angle supported by the human presence sensor, in degrees.

MinDetectableDistanceInMillimeters

Gets the minimum distance the human presence sensor can detect a user.

Methods

FromId(String)

Synchronously retrieves a reference to the human presence sensor associated with the provided device ID.

FromIdAsync(String)

Asynchronously retrieves a reference to the human presence sensor associated with the provided device ID.

GetCurrentReading()

Retrieves the current sensor reading from the human presence sensor.

GetDefault()

Synchronously retrieves a reference to the default human presence sensor.

GetDefaultAsync()

Asynchronously retrieves a reference to the default human presence sensor.

GetDeviceSelector()

Retrieves an Advanced Query Syntax (AQS) string used to enumerate the available human presence sensors.

Events

ReadingChanged

Occurs whenever there is a significant change in the human presence sensor reading.

Applies to

See also