QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _ALLOWFULLSCREEN statement allows setting the behavior of the ALT+ENTER combo.

Syntax

_ALLOWFULLSCREEN [{_STRETCH _SQUAREPIXELS OFF _ALL}][, {_SMOOTH OFF _ALL}]

Description

Availability

Example(s)

Allowing only one full-screen mode with square pixels and no anti-aliasing:


_ALLOWFULLSCREEN _SQUAREPIXELS, OFF

Disabling _FULLSCREEN with Alt+ENTER so the combo can be manually trapped:


DO
    CLS

    LOCATE 7
    PRINT "    - Press ALT+ENTER to test trapping the combo..."
    PRINT "    _ Press SPACEBAR to allow fullscreen again..."

    k& = _KEYHIT

    IF k& = 13 THEN
        IF _KEYDOWN(100307) OR _KEYDOWN(100308) THEN
            altEnter = altEnter + 1
        END IF
    ELSEIF k& = 32 THEN
        fullscreenEnabled = NOT fullscreenEnabled
    END IF

    LOCATE 14
    IF fullscreenEnabled THEN
        _ALLOWFULLSCREEN _ALL, _ALL
        altEnter = 0
        PRINT "_ALLOWFULLSCREEN _ALL, _ALL"

        LOCATE 18
        PRINT "ALT+ENTER will trigger all four fullscreen modes now."
    ELSE
        _ALLOWFULLSCREEN OFF
        PRINT "_ALLOWFULLSCREEN OFF"
    END IF

    IF altEnter THEN
        LOCATE 18
        PRINT "ALT+ENTER manually trapped"; altEnter; "times."
    END IF

    _DISPLAY
    _LIMIT 30
LOOP

See Also