Skip to content

Detecting keydown events while typing in the input field with WebGLInput #40

@nicanorrr

Description

@nicanorrr

Hi, while I'm typing in the InputField, I tried to detect keydown events using Input.anyKeyDown so that after a key is typed into the input field, the string is saved through playerprefs. It works in the editor but isn't working when I build to WebGL. Am I correct in assuming it is because of how WebGLInput works that it blocks some of the keyboard input while a InputField is being typed into?

How I'm doing it is something like this:

void Update(){
    if (Input.anyKeyDown){
        // my code for saving data
    }
}

If yes, is there another way I can allow my unity code to detect when a player has typed into the input field? Thank you :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions