#!/usr/bin/env python

# Prints curses' keycodes on screen, just press ctrl-c to exit

import curses
import curses.wrapper

def main( stdscr ):
    stdscr.scrollok( 1 )    
    while 1:
        c= stdscr.getch()
        stdscr.addstr( 'KEY= %s\n' % hex(c) )

curses.wrapper(main)
