1

I have some issues with Google Keyboard in my Android game.
When Google Keyboard opens in my activity, the behavior becomes very funny
- touch to keyboard zone goes through it to my activity and presses buttons there
- touch to activity (upper keyboard zone) becomes freezing and doesn't produce any events

There are no one problem with default Android keyboard.
So, how to define Google Keyboard in code?

rock_walker
  • 453
  • 5
  • 14

1 Answers1

0

My efforts for defining Google Keyboard were not succeeded.
I tried with next piece of code:

var _manager = (InputMethodManager) view.Context.GetSystemService(Context.InputMethodService)

var subType = _manager.CurrentInputMethodSubtype;

if (subType.ContainsExtraValueKey("SupportTouchPositionCorrection") ||
                subType.ContainsExtraValueKey("KeyboardLayoutSet"))
{
    //Hide keyboard
}

I investigated extra values of Swift, Swype, native Android keyboards and looked like Google keyboard was differed from those keyboards.

But, generally, it was incorrect way of investigation.
What was really helpful - overriding of method OnCreateInputConnection on my root View

public override IInputConnection OnCreateInputConnection(EditorInfo editorInfo)
        {
            editorInfo.ImeOptions = ImeFlags.NoExtractUi;
            editorInfo.InputType = InputTypes.Null;
            return new BaseInputConnection(this, false);
        }

ImeFlags.NoExtractUi

helped me to fix incorrect displaying Google keyboard.
Correct thread to read is here

Community
  • 1
  • 1
rock_walker
  • 453
  • 5
  • 14