sdlterm/demo.py
author Radek Brich <radek.brich@devl.cz>
Sat, 05 Jan 2013 16:47:30 +0100
changeset 49 1611c462c3e3
parent 48 1f00e90fd72a
child 69 4e7be77bafff
permissions -rwxr-xr-x
Update sdlterm: Optimize commit() - use two cell buffers, redraw only dirty cells, not everything. Fix keypress event, filter mousemove.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
sys.path.insert(0, 'build/lib.linux-x86_64-3.2')

from sdlterm import SDLTerminal

if __name__ == '__main__':
    term = SDLTerminal()
    term.resize(800, 600)
    term.select_font("font/DejaVuSansMono.ttf", "font/DejaVuSansMono-Bold.ttf", 12)
    term.erase()
    term.putch(5, 5, 'W')
    term.commit()

    while True:
        event = term.get_next_event()
        print(event)
        if event[0] == 'keypress' and event[1] == 'escape':
            break