3DGS key_pressed function
At the bottom of the page of the Manual you can see the "See also" references. Those are also worth a peek.