How to make virtual joystick trigger thumbstick button press/release events?

Have you figured out how to do this? Would also like to know how to do this.