#include "BearLibTerminal.h"

int main() {
        terminal_open();
        terminal_set("window.fullscreen=false");
        //terminal_set("input.alt-functions=false");
        terminal_set("log.level=trace");
        int loop = 1, fs = 0, i = 0;      

        while (loop) {
                terminal_clear();
                terminal_printf(1, 1, "%d", i++);
                terminal_refresh();

                int key = terminal_read();
                switch(key) {
                case TK_ESCAPE:
                        loop = 0;
                        break;

                case TK_ENTER:
                        if (fs) {
                                terminal_set("window.fullscreen=false");
                                fs = 0;
                        } else {
                                terminal_set("window.fullscreen=true");
                                fs = 1;
                        }

                default:
                        break;
                }
        }
        terminal_close();
}
Edit

Pub: 13 Oct 2020 18:13 UTC

Edit: 13 Oct 2020 18:18 UTC

Views: 132