close
偵測手機倒退鍵
Form > KeyDown
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
Shift: TShiftState);
begin
if Key = vkHardwareBack then //按下手機的到退鍵
begin
if tc_Main.ActiveTab = ti_SelHost then //主畫面>首頁
Exit
else if tc_Main.ActiveTab = ti_Menu then begin
btn_backClick(btn_back);
end else if tc_Main.ActiveTab = ti_MouseControl then begin
tc_Main.ActiveTab := ti_Menu;
end;
//阻擋倒退鍵 否則會直接離開APP
Key:=0;
end;
end;
文章標籤
全站熱搜