//「S」キーが押されたら画像を保存する void onKeyDown(int id, string key){ if(key == "S"){ exportGraphics(getGraphics(), "test.jpg", "JPEG", 100.0); // JPEG(100%)で保存 } }