bug-ncurses
[Top][All Lists]
Advanced

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

Snow Leopard Cursor Keys broken.


From: Nicholas Cole
Subject: Snow Leopard Cursor Keys broken.
Date: Thu, 8 Apr 2010 18:28:22 +0100

Dear List,

I'm having a strange curses problem on Mac OS 10.6.3.  If I use the
system provided python, curses applications do not correctly interpret
arrow keys (I've tried both with xterm and with Terminal.app, so I
don't think it is a terminal problem).  If I use the version of python
I've installed from fink, everything works as expected.

This is definitely a 10.6.3 problem.  When I found the problem on my
Desktop machine, I tested 10.6.2 on my laptop and it worked fine.
Upgrading to 10.6.3 broke the cursor keys in exactly the same way.

I've attached code that demonstrates the problem.  On 10.6.2 the left
arrow key produces "KEY_LEFT".  On 10.6.3 it produces "D"

Best wishes,

Nicholas




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

def mainloop(scr):
    S = npyscreen.Form()
    display=S.add_widget(npyscreen.TitleText, name="Key name:")
    S.display()
    while 1:
        S.curses_pad.keypad(1)
        curses.cbreak()
        curses.raw()
        curses.cbreak()
        #S.curses_pad.nodelay(1)
        ch = S.curses_pad.getch()
        try:
            display.value="%s : %s" % (curses.keyname(ch), ch)
        except:
            pass
        S.display()

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




reply via email to

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