P5.js Auto Full Screen in Chrome

edited May 2017 in p5.js

Right now I have automated display computers that autorun a P5.js sketch. Is there a way I can code the sketch to automatically open in fullscreen using my chrome browser?

Answers

  • Answer ✓

    Neither the displayWidth method and the fullscreen method worked for me. However I just solved the issue by writing a vbs file that uses the hotkey F11 and F5 to go fullscreen and reload:

    Set oShell = CreateObject("WScript.Shell")
    oShell.Run("""C:\Program Files\Google\Application\chrome.exe""")
    WScript.Sleep 3000
    oShell.AppActivate "chrome"
    WScript.Sleep 3000
    oShell.SendKeys "~"
    oShell.SendKeys "{F11}"
    oShell.SendKeys "~"
    oShell.SendKeys "{F5}"
    

    Saved as .vbs Works.

  • Glad you found a solution!

    Mac / Linux users who are trying to maximize a p5.js sketch in a browser on launch may need to use an alternate form of desktop/keyboard macro scripting, as this use of vbs/shell is Windows-specific.

Sign In or Register to comment.