Closed Bug 922478 Opened 11 years ago Closed 6 years ago

[Keyboard] Have a way to disable / enable soft keyboards

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: janjongboom, Unassigned)

References

Details

Attachments

(1 file)

Feature request from apc.io at https://github.com/apc-io/apc-firefox-os/issues/8

They would like to have a way to disable the soft keyboard (other than via a pref). I guess the nice way would to add an API to navigator.mozInputMethod.mgmt in Gecko to handle this. Should not be very hard.

:yxl, what do you think?
Flags: needinfo?(xyuan)
Assignee: nobody → janjongboom
It is reasonable way to add an API for that. But we need Rudy to confirm the requirement before implementation.
Flags: needinfo?(xyuan) → needinfo?(rlu)
Attached patch Gecko partSplinter Review
I think Rudy is traveling from Canada or something. Anyway, I was in a plane for two hours and didn't have anything to do, so here's the gecko part.
Attachment #815384 - Flags: review?(xyuan)
Blocks: 925357
Comment on attachment 815384 [details] [diff] [review]
Gecko part

Review of attachment 815384 [details] [diff] [review]:
-----------------------------------------------------------------

r=me. The code looks good to me.

::: dom/inputmethod/MozKeyboard.js
@@ +243,5 @@
>  
>  MozInputMethodManager.prototype = {
>    _supportsSwitching: false,
>    _window: null,
> +  _softKeyboardEnabled: true,

I prefer to using `false` as default value.

@@ +289,5 @@
> +  },
> +
> +  get softKeyboardEnabled() {
> +    if (!WindowMap.isActive(this._window)) {
> +      return true;

The same. When keyboard is not active, return false.

::: dom/webidl/InputMethod.webidl
@@ +57,5 @@
>    void hide();
> +
> +  // Tell the OS to enable/disable the soft keyboard
> +  // f.e. when a hardware keyboard is attached.
> +  attribute boolean softKeyboardEnabled;

Can we use the name `enabled` without prefix as that of the `hide()` method? Is the prefix `softKeyboard` necessary?
Attachment #815384 - Flags: review?(xyuan) → review+
(In reply to Yuan Xulei [:yxl] from comment #4)
> I prefer to using `false` as default value.
I don't really agree, the default should be that soft keyboard would pop up as it's the desired behavior for 99,999% of all devices running FxOS at the moment.

> Can we use the name `enabled` without prefix as that of the `hide()` method?
> Is the prefix `softKeyboard` necessary?
Could be, but it misses context. `mgmt.enabled = false` would give me the impression that you can disable the `mgmt` module or something. Let me know if you agree/disagree.
Sorry for late reply.
Yes, we need an API to know if there is an hardware keyboard present for the device.

Does the current implementation conform to what Tim proposed in,
https://wiki.mozilla.org/User:Timdream/InputMethod_API_with_hardware_keyboard

If not, can we counter propose there?
Thanks.
Flags: needinfo?(rlu)
I added comments in the API proposal. We're trying to reach the same path as in the proposal, so let's finish that discussion first before continuing here.
Assignee: janjongboom → nobody
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: