Touch Inputs Detected As Keyboard Inputs?

I’ve written some code in order to detect, after an input was made, what is the current input mode of the player:

Problem is, when running the game on my phone, sometime it suddenly changes the input mode to Mouse And Keyboard, which can only happen if, as can be seen above:

  1. no finger is touching the screen. here’s the code for the macro:
  2. key is not a gamepad key
  3. the game receives mouse movement inputs which aren’t 0
  4. the pressed key is a mouse key
  5. the pressed key is a keyboard key

After some testing, it seems like the “Is Keyboard Key” node returns true sometimes when I touch my phone’s screen with my fingers, while no keyboard is connected to it.

Is this a bug? Has anyone else come across this?

this is definitely a bug:
Screenshot (303)

As you can see, I tried printing for every input whether it’s a keyboard key or not. And guess what was printed on my phone’s screen after tapping and moving my fingers on screen?

That’s right. Every single touch input I made was detected as a keyboard key.
For some reason, it seems like there’s an instant right after releasing my fingers from pressing the screen at which the AnyKey is for some reason called, no finger is touching the screen and the key is detected as a keyboard key.

This is very weird. Is there a fix?