HardwareButtons HardwareButtons HardwareButtons HardwareButtons Class

Definition

Provides access to the phone's hardware buttons.

public : static class HardwareButtons
public static class HardwareButtons
Public Static Class HardwareButtons
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)

Remarks

Windows Phone 8

This API is supported in native apps only.

Events

BackPressed BackPressed BackPressed BackPressed

Occurs when the user presses the hardware Back button.

public : event EventHandler BackPressed<BackPressedEventArgs>
public event EventHandler BackPressed<BackPressedEventArgs>
Public Event EventHandler BackPressed( Of ( Of BackPressedEventArgs ))
function onBackPressed(eventArgs){/* Your code */}


hardwareButtons.addEventListener("backPressed", onBackPressed);
hardwareButtons.removeEventListener("backPressed", onBackPressed);

CameraHalfPressed CameraHalfPressed CameraHalfPressed CameraHalfPressed

Occurs when the user presses the hardware camera button halfway.

public : event EventHandler CameraHalfPressed<CameraEventArgs>
public event EventHandler CameraHalfPressed<CameraEventArgs>
Public Event EventHandler CameraHalfPressed( Of ( Of CameraEventArgs ))
function onCameraHalfPressed(eventArgs){/* Your code */}


hardwareButtons.addEventListener("cameraHalfPressed", onCameraHalfPressed);
hardwareButtons.removeEventListener("cameraHalfPressed", onCameraHalfPressed);

CameraPressed CameraPressed CameraPressed CameraPressed

Occurs when the user presses the hardware camera button.

public : event EventHandler CameraPressed<CameraEventArgs>
public event EventHandler CameraPressed<CameraEventArgs>
Public Event EventHandler CameraPressed( Of ( Of CameraEventArgs ))
function onCameraPressed(eventArgs){/* Your code */}


hardwareButtons.addEventListener("cameraPressed", onCameraPressed);
hardwareButtons.removeEventListener("cameraPressed", onCameraPressed);
See Also

CameraReleased CameraReleased CameraReleased CameraReleased

Occurs when the user releases the hardware camera button.

public : event EventHandler CameraReleased<CameraEventArgs>
public event EventHandler CameraReleased<CameraEventArgs>
Public Event EventHandler CameraReleased( Of ( Of CameraEventArgs ))
function onCameraReleased(eventArgs){/* Your code */}


hardwareButtons.addEventListener("cameraReleased", onCameraReleased);
hardwareButtons.removeEventListener("cameraReleased", onCameraReleased);