From QB64 Wiki
Revision as of 03:17, 16 June 2020 by Odin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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




  • Calling the statement with no parameters enables all four possible full screen modes (and is the default state when a program is started): both _STRETCH (_SMOOTH and _OFF) and _SQUAREPIXELS (_SMOOTH and _OFF).
  • _ALLOWFULLSCREEN only affects the behavior of ALT+ENTER. The _FULLSCREEN statement is not bound by _ALLOWFULLSCREEN's settings so all modes can be accessed programmatically.
  • To limit just the mode but allow both _SMOOTH + _OFF antialiasing modes, pass just the first parameter: Example: _ALLOWFULLSCREEN _SQUAREPIXELS
  • To allow multiple modes with _SMOOTH or _OFF as default, pass just the second parameter. Example: _ALLOWFULLSCREEN , _SMOOTH
  • Any possible permutation of the parameters is allowed.
  • With _ALLOWFULLSCREEN _OFF you can trap Alt+Enter manually in your program and reassign it. See example 2 below.


  • Version 1.3 and up.


Example 1: Allowing only one fullscreen mode with square pixels and no antialiasing:


Example 2: 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

Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page