How does the 'keyPressed' function work with Particle?

Hi guys,

This is my first time programming with the Particle Photon and I’m trying to figure out how the keyPressed function works. I basically want the D0 pin to write to HIGH whenever I press and hold a key. It doesn’t seem to work this way…

Where have you got that keyPressed “command” from?
And what key would this press refer to?

I’m unaware of such a command existing (unless inside some 3rd party library).