Bug 1213845 - enable osk support on windows 8, but hide it behind a preference, r=jaws

This commit is contained in:
Gijs Kruitbosch 2015-10-16 16:28:13 +01:00
parent 1053ec2614
commit dfee8eb78a
2 changed files with 15 additions and 14 deletions

View File

@ -3268,9 +3268,9 @@ pref("ui.osk.enabled", true);
pref("ui.osk.detect_physical_keyboard", true);
// Path to TabTip.exe on local machine. Cached for performance reasons.
pref("ui.osk.on_screen_keyboard_path", "");
// Only show the on-screen keyboard when Windows is in Tablet mode. Setting
// this pref to false will allow the OSK to show in regular non-tablet mode.
pref("ui.osk.require_tablet_mode", true);
// Only try to show the on-screen keyboard on Windows 10 and later. Setting
// this pref to false will allow the OSK to show on Windows 8 and 8.1.
pref("ui.osk.require_win10", false);
// This pref stores the "reason" that the on-screen keyboard was either
// shown or not shown when focus is moved to an editable text field. It is
// used to help debug why the keyboard is either not appearing when expected

View File

@ -28,7 +28,7 @@
const char* kOskPathPrefName = "ui.osk.on_screen_keyboard_path";
const char* kOskEnabled = "ui.osk.enabled";
const char* kOskDetectPhysicalKeyboard = "ui.osk.detect_physical_keyboard";
const char* kOskRequireTabletMode = "ui.osk.require_tablet_mode";
const char* kOskRequireWin10 = "ui.osk.require_win10";
const char* kOskDebugReason = "ui.osk.debug.keyboardDisplayReason";
namespace mozilla {
@ -539,21 +539,22 @@ void
IMEHandler::MaybeShowOnScreenKeyboard()
{
if (sPluginHasFocus ||
!IsWin10OrLater() ||
!IsWin8OrLater() ||
!Preferences::GetBool(kOskEnabled, true) ||
sShowingOnScreenKeyboard ||
IMEHandler::IsKeyboardPresentOnSlate()) {
return;
}
// Tablet Mode is only supported on Windows 10 and higher.
// When touch-event detection within IME is better supported
// this check may be removed, and ShowOnScreenKeyboard can
// run on Windows 8 and higher (adjusting the IsWin10OrLater
// guard above and within MaybeDismissOnScreenKeyboard).
if (!IsInTabletMode() &&
Preferences::GetBool(kOskRequireTabletMode, true) &&
!AutoInvokeOnScreenKeyboardInDesktopMode()) {
// On Windows 10 we require tablet mode, unless the user has set the relevant
// Windows setting to enable the on-screen keyboard in desktop mode.
// We might be disabled specifically on Win8(.1), so we check that afterwards.
if (IsWin10OrLater()) {
if (!IsInTabletMode() && !AutoInvokeOnScreenKeyboardInDesktopMode()) {
return;
}
}
else if (Preferences::GetBool(kOskRequireWin10, true)) {
return;
}
@ -565,7 +566,7 @@ void
IMEHandler::MaybeDismissOnScreenKeyboard()
{
if (sPluginHasFocus ||
!IsWin10OrLater() ||
!IsWin8OrLater() ||
!sShowingOnScreenKeyboard) {
return;
}