bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

more OS X oddities


From: Nicholas Cole
Subject: more OS X oddities
Date: Sat, 15 Apr 2006 16:20:36 +0200

Why does this code give the name of function keys on linux, but not on
OS X? I can't work out any way of capturing a function-key press
(either in X11 or Terminal.app) on OS X.

Best, N.

#!/usr/bin/python
import curses
import curses.ascii

def mainloop(scr):
        while 1:
                scr.keypad(1)
                ch = scr.getch()
                try:
                        scr.erase()
                        scr.addstr(0,0, "%s, %s,  %s" %
                        (curses.keyname(ch), curses.ascii.unctrl(ch), ch))
                except:
                        pass
                scr.refresh()

if __name__ == "__main__":
        curses.wrapper(mainloop)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]