apc-io / apc-firefox-os

Firefox OS on APC
94 stars 28 forks source link

Hide onscreen keyboard #8

Open moskovich opened 10 years ago

moskovich commented 10 years ago

When typing, sometimes the on screen keyboard appears at times. Please hide this always.

Gioyik commented 10 years ago

Hi,

I have a question before send a Pull request for this. Is necessary to keep the Gaia keyboard in the apc-io Gaia source? Will you use it?

Regards, Gio

janjongboom commented 10 years ago

Set the pref dom.mozInputMethod.enabled to false after #906096 lands. Did I win?

ntlc commented 10 years ago

@Gioyik yes, we should support cases where hardware keyboard is absent, in which case user should be presented with the virtual keyboard. So the use cases are:

  1. When a hardware keyboard is connected, virtual keyboard should never show.
  2. When the hardware keyboard is not connected, input is entered using mouse and virtual keyboard.

Hardware keyboards might be plugged in at boot time, or on-the-fly.

@janjongboom We will investigate this further, tks for pointing this out.

ntlc commented 10 years ago

@janjongboom The setting you mentioned in your earlier comment disabled completely the software keyboard, which is not exactly what we want (see also my answer to @Gioyik above). Another hint? :)

janjongboom commented 10 years ago

@ntlc Sure. Where would the management code live? In system app? If system app it can be hacked into gaia, otherwise will need a gecko fix to add this to navigator.mozInputMethod.mgmt.

I created a tracking bug in https://bugzilla.mozilla.org/show_bug.cgi?id=922478

ntlc commented 10 years ago

Thanks for the bugzilla request. In the meantime, our Free APC remains open to any patch allowing this feature working while waiting for Mozilla (which might be slow) :) All source code is open to public, pls feel free to pull and give it a try :)

janjongboom commented 10 years ago

Gecko and Gaia patches have been submitted in bugzilla. To give it a try, build with the patch applied (f.e. ./mach build) and run the gaia branch.

navigator.mozInputMethod.mgmt.softKeyboardEnabled = false

Can be called from any app with the keyboard permission (warning, will be renamed to inputmethod) to disable soft keyboards in Firefox OS.

ntlc commented 10 years ago

@janjongboom what is tricky here is to detect the presence/absence of the hardware keyboard in order to disable/enable the software keyboard accordingly. Your patch does take care of the second action, but the critical part (event detection and propagation/notification) is still missing. Would you be interested in continuing the challenge? :)

janjongboom commented 10 years ago

@ntlc The device gets connected in https://github.com/apc-io/apc_b2g_gecko/blob/3fd923659543230db0adb72242037a9990b6261c/widget/gonk/libui/EventHub.cpp#L1100, should throw up an event if keyboard is connected. Then listen in MozKeyboard.js for that event and set mgmt.softKeyboardEnabled to false (or pass it through to gaia via a chrome event and handle it there).

I don't have the time to dive into Gonk a.t.m. but anyone who worked with it should pretty easily be able to write that part.

janjongboom commented 10 years ago

We're talking about a hardware keyboard event on this page: https://wiki.mozilla.org/User:Timdream/InputMethod_API_with_hardware_keyboard#Idea

timdream commented 10 years ago

Hi all, I am the original author of the API proposal above. I believe the API proposal cover the use case here so if there is no objection I highly recommend to patch Gecko according to the API proposal. It seems like @janjongboom have already done so on https://bugzilla.mozilla.org/show_bug.cgi?id=922478

The usual place to discuss API implementation is the https://lists.mozilla.org/listinfo/dev-webapi mailing list.

I wonder if there is any @apc-io developers interested to contribute the entire API? That will enable hardware keyboard to talk to Keyboard app, thus enabling Asian IMEs / Latin language spell check, etc. I am thankful @janjongboom's effort to contribute but we need to prioritize features on Mozilla roadmap.

Do connect me on timdream@mozilla.com

ntlc commented 10 years ago

Hi, we've completed our implementation of this use case and is checking if code from @janjongboom can be reused/applied/integrated somehow. Feature is under testing, code is under review and should be available soon, if you're interested in having a look. Thanks for your contributions.

janjongboom commented 10 years ago

Great, if you want to sync up with implementation according to proposed spec please drop me a line as well.

woutervddn commented 10 years ago

last version of gaia autohides the keyboard when you enable desktop shims, see: https://developer.mozilla.org/en-US/Firefox_OS/Using_the_B2G_desktop_client#Generating_a_profile

trungnt commented 10 years ago

@woutervddn : Thank you! We will check it out!

janjongboom commented 10 years ago

@ntlc Is the code for this going to be contributed back? It would be useful for all of FFOS.

trungnt commented 10 years ago

@woutervddn: we are using the official gaia (master branch) from mozillaorg: https://git.mozilla.org/releases/gaia. I've just update our code to the newest one from that repo and seem it does not support desktop shims? Btw, if I understand correctly, the link you pointed us is for settings up B2G desktop client, which the hardware keyboard is always available, and the desktop shims will disable software keyboard all the time. If I'm not wrong then that is not what we need. We need to hide software keyboard only if the hardware keyboard is connected!

@janjongboom: That should be :)

kwonjeagu1 commented 10 years ago

When typing, sometimes the on screen keyboard appears at times. Please hide this always.

BalaKeelapudi commented 9 years ago

Hey folk

There is an another way you could resolve this issue.

There is an application call null key board in appstore.

Install it on your android OS and select this key board as the default key board.

SInce null keyboard is selected u will never seea key board when the key board is connected.

My proposal is a small algorithm which as given below. 1) sacan USB 2) IF USB detected. 3) Then assign Null key board as the default keyboard. 4) Else restore to Android default keyboard.

Hope this method helps to resolve this issue.

I am not an expert in Android programming but i can write some basic code. if a programing expert can assist me i will be able to solve this issue.

Cheers Bala Keelapdui

BalaKeelapudi commented 9 years ago

I am sorry for my typo errors

neelakatappa commented 8 years ago

ignore it the best solution i hope!!!