This function will poll the Steam API to see if the key for taking a screenshot of the game has been pressed. The function will only return true for one step (game tick) if the key has been pressed, and will return false at all other times.
var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");
steam_send_screenshot(file, window_get_width(), window_get_height());
global.scrn_num += 1;
The above code will poll the Steam API for a screenshot request and if it has been, a unique name for the image file will be generated, a screenshot will be taken, and the file will be sent to the Steam Community page for the user.