TouchScreenButton: How to support simultaneous press & hold without accidental release?

Hi everyone,
I’m currently working on a Godot 4 project called “pop-kun controller”, which is a virtual controller for the pop’n music rhythm game.

What I’m trying to achieve

I want the controller to behave like real arcade buttons:

  • Multiple buttons can be pressed at the same time (for example: buttons 1, 2, and 5).

  • When pressed, they should stay held until the user actually releases them.

  • No sudden or accidental release events while the finger is still on the screen.

The problem

Right now, when I press multiple TouchScreenButtons at once on my phone, sometimes one of them triggers a released signal even though my finger is still holding it.

I’m not sure if:

  • This is a mobile touch limitation, or

  • My code structure is wrong

Current code

Here is the code I’m using to create and handle the buttons:

@tool
extends Control

signal send_signal

@onready var upper_buttons: HBoxContainer = $VBoxContainer/UpperButtons
@onready var bellow_buttons: HBoxContainer = $VBoxContainer/LowerButtons2

func _ready() -> void:
	create_buttons(upper_buttons)
	create_buttons(bellow_buttons)

func create_buttons(con) -> void:
	for container in con.get_children():
		var scale_set := 1.2
		var con_size := 200
		container.custom_minimum_size = Vector2(con_size * scale_set, con_size * scale_set)

		var btn: TouchScreenButton = container.get_children()[0]
		if btn is TouchScreenButton:
			btn.scale = Vector2(scale_set, scale_set)

			btn.pressed.connect(func() -> void:
				if Global.enableVibration:
					Input.vibrate_handheld(50)
				$Node.send_data(JSON.stringify({ btn.name: "P" }))
			)

			btn.released.connect(func() -> void:
				$Node.send_data(JSON.stringify({ btn.name: "R" }))
			)

My controller design:

My scene tree:

My question

  • How can I reliably detect simultaneous button presses?

  • How can I prevent unwanted release signals while a button is still being held?

  • Is TouchScreenButton the right node for this, or should I use something else?

Any advice, best practices, or examples would be greatly appreciated.
Thank you in advance—I really hope I can find a solution :folded_hands: