var moving;
    moving = keyboard_check(global.left) or keyboard_check(global.right) or keyboard_check(global.jump);
    if((global.mouselock == 2) or ((global.mouselock == 1) and moving))
    {
        if (mouse_x &lt; view_xview + 1) 
            window_views_mouse_set(view_xview + 1, mouse_y);
        if (mouse_y &lt; view_yview + 1) 
            window_views_mouse_set(mouse_x, view_yview + 1);
        if (mouse_x &gt; view_xview + view_wview - 1) 
            window_views_mouse_set(view_xview + view_wview - 1, mouse_y);
        if (mouse_y &gt; view_yview + view_hview - 1) 
            window_views_mouse_set(mouse_x, view_yview + view_hview - 1);
    }