summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrtscreen.h
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-03-07 12:39:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-07 22:27:25 +0100
commit7625c51ef426b73a8bda5853a4bd2e2d9d3aeb55 (patch)
tree6b1cf0a36e53de46718e5cacd31edfd24d3f818c /src/plugins/platforms/winrt/qwinrtscreen.h
parent3a1c223a0a207c76ab28e5a948f00db92f8fabc5 (diff)
Windows Phone: Handle back-button press
When the back button is pressed, send an immediate key event to the topmost window (or the application if there is no window). If it is accepted, mark the native event as accepted and send a key release event. This way, the application may call accept() on the KeyPress event for Qt::Key_Back in order to create backstepping behaviors within the app. This is in line with Android, which quits the app when the event is ignored. On Windows Phone, the default behavior occurs when the event is ignored, which is to back out of the application and leave it running in the background. Task-number: QTBUG-35951 Change-Id: I46d15478f441f73d3660370370689b2f9fa11f25 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtscreen.h')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h
index 3131f879b5..c6511e9446 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.h
+++ b/src/plugins/platforms/winrt/qwinrtscreen.h
@@ -80,6 +80,15 @@ namespace ABI {
struct IDisplayPropertiesStatics;
}
}
+#ifdef Q_OS_WINPHONE
+ namespace Phone {
+ namespace UI {
+ namespace Input {
+ struct IBackPressedEventArgs;
+ }
+ }
+ }
+#endif
}
}
struct IInspectable;
@@ -149,6 +158,10 @@ private:
HRESULT onOrientationChanged(IInspectable *);
+#ifdef Q_OS_WINPHONE
+ HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args);
+#endif
+
ABI::Windows::UI::Core::ICoreWindow *m_coreWindow;
ABI::Windows::UI::ViewManagement::IApplicationViewStatics *m_applicationView;
ABI::Windows::ApplicationModel::Core::ICoreApplication *m_application;