gree / gree/unity-webview

Lost button input outside of the webview on Android

Open
#400 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

Description

Hi,

When I have a webview on Android I can no longer capture input from keyboard / controller buttons. I need to use up/down/left/right arrows to select buttons in my UI outside of the webview. This works when running in editor on macOS but not on Android.

I added this to the update function but it is not detecting the button presses when the webview is active:

    if (Input.GetKeyDown(KeyCode.LeftArrow))
    {
        Debug.Log("Left Arrow Pressed");
    }

    if (Input.GetKeyDown(KeyCode.RightArrow))
    {
        Debug.Log("Right Arrow Pressed");
    }

    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("Up Arrow Pressed");
    }

    if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Down Arrow Pressed");
    }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on Android with an active webview and inspect the Update function containing the Input.GetKeyDown arrow checks. Compare behavior with the macOS editor case and trace how keyboard or controller input is routed while the webview is active. Done means the arrow button presses are detected outside the webview on Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, unity
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.