Connecting joystick and buttons to common ground

The pcb has more than one ground. Is it possible to connect the joystick to one ground and the buttons to a different ground. Or does it all have to be at the same gorund?

Assuming you’re using a single PCB there is no problem having multiple common lines for your switches so long as you don’t accidentally bridge the two commons together.