HardwareButtons HardwareButtons HardwareButtons HardwareButtons HardwareButtons Class

Definition

Provides access to the phone's hardware buttons.

public : static class HardwareButtons
static struct winrt::Windows::Phone::UI::Input::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 BackPressed

Occurs when the user presses the hardware Back button.

public : event EventHandler BackPressed<BackPressedEventArgs>
// Register
event_token BackPressed(EventHandler<BackPressedEventArgs> const& handler) const;

// Revoke with event_token
void BackPressed(event_token const& cookie) const;

// Revoke with event_revoker
BackPressed_revoker BackPressed(auto_revoker_t, EventHandler<BackPressedEventArgs> const& handler) const;
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 CameraHalfPressed

Occurs when the user presses the hardware camera button halfway.

public : event EventHandler CameraHalfPressed<CameraEventArgs>
// Register
event_token CameraHalfPressed(EventHandler<CameraEventArgs> const& handler) const;

// Revoke with event_token
void CameraHalfPressed(event_token const& cookie) const;

// Revoke with event_revoker
CameraHalfPressed_revoker CameraHalfPressed(auto_revoker_t, EventHandler<CameraEventArgs> const& handler) const;
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 CameraPressed

Occurs when the user presses the hardware camera button.

public : event EventHandler CameraPressed<CameraEventArgs>
// Register
event_token CameraPressed(EventHandler<CameraEventArgs> const& handler) const;

// Revoke with event_token
void CameraPressed(event_token const& cookie) const;

// Revoke with event_revoker
CameraPressed_revoker CameraPressed(auto_revoker_t, EventHandler<CameraEventArgs> const& handler) const;
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 CameraReleased

Occurs when the user releases the hardware camera button.

public : event EventHandler CameraReleased<CameraEventArgs>
// Register
event_token CameraReleased(EventHandler<CameraEventArgs> const& handler) const;

// Revoke with event_token
void CameraReleased(event_token const& cookie) const;

// Revoke with event_revoker
CameraReleased_revoker CameraReleased(auto_revoker_t, EventHandler<CameraEventArgs> const& handler) const;
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);