我試圖將現有的Back,Start按鈕使用javascript映射到兩個按鈕中。我在下面試過。如何在Windows Mobile 10中使用C#訪問返回和啓動按鈕?
https://docs.microsoft.com/en-us/uwp/api/windows.phone.ui.input.hardwarebuttons
var hardwareButtons = Windows.Phone.UI.Input.HardwareButtons;
function backPressed() {
hardwareButtons.addEventListener("backpressed", function (e) {
// Navigate back in your webview.
e.handled = true; // Notifies OS that you've handled the back button event.
alert("Back pressed");
});
}
但這隻有攝像頭,只有後退按鈕。我想分別訪問開始和結束按鈕,或觸發多任務視圖並顯示開始操作。任何人有一個想法?
有一個['SystemNavigationManager'](https://docs.microsoft.com/en-us/uwp/api/windows.ui.core.systemnavigationmanager)類來處理返回按鈕按下。 –