add keyboard event handling (wip, segfaults)