title: Handling Hard Button vkHardwareBack
body: <p>In my application I use TTabControl with 3 tabs: Main Tab (TabItem1) with 3 buttons: Button1 will take me to TabItem2, Button2 to TabItem3, and Button 3 to TabItem3.</p>
  
  <p>I handle FormKeyUp Event to Control the Navigation and:</p>
  
  <p>If the key pressed is vkHardwareBack then if the ActiveTab is the TabItem1, I popup a message asking if the user wants to quit the application. If the answer is yes, I close the application and if not nothing happens. this part is working just fine!</p>
  
  <p>But if the ActiveTab is TabItem2 or TabItem3 then I want the application to go back to the Main Tab (TabItem1) by firing TTabChangeItem standard action with properties:</p>
  
  <ul>
  <li>Tab: TabItem1</li>
  <li>Direction: tdReversed</li>
  <li>Transaction: ttSlide </li>
  </ul>
  
  <p>But this is not happening. When the user is pressing the vkHardwareBack while the ActiveTab is TabItem2 or TabItem3 the application goes to background and the home screen is shown.</p>
  
  <p>Any Idea what am I doing wrong?</p>
  
  <p>And here is a the FormKeyUp procedure:</p>
  
  <pre><code>procedure TfMain.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
    Shift: TShiftState);
  begin
    if Key = vkHardwareBack then
      if TabControl.ActiveTab = TabItem1 then
        if MessageDlg('Are you sure you want to Exit?', TMsgDlgType.mtWarning,
             [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0) = mrYes then
          MainActivitiy.finish
       else
         ChangeTabAction1.Execute; // I tried here also: TabControl.ActiveTab := TabItem2; but still the same results
  end;
  </code></pre>