Create an object and within the Create Event, add the following:
Code:
fullscreen = false;
screen_width = display_get_width();
screen_height = display_get_height();
Within the Step Event, add the following:
Code:
if(keyboard_check_pressed(vk_f4)){
if(!fullscreen){
fullscreen = true;
window_set_fullscreen(true);
display_set_gui_size(screen_width, screen_height);
surface_resize(application_surface, screen_width, screen_height);
} else{
fullscreen = false;
window_set_fullscreen(false);
display_set_gui_size(screen_width, screen_height);
surface_resize(application_surface, screen_width, screen_height);
}
}
Make the object persistent and add it to your room
You can replace the vk_f4 with whatever key you want.
Hope this helps, or at least points you in the right direction