Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR/AA) Newsgroups: comp.unix.programmer Subject: Re: CURSES Message-ID: <1991May3.011507.14093@NCoast.ORG> Date: 3 May 91 01:15:07 GMT References: <1991May1.192004.25227@msuinfo.cl.msu.edu> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR/AA) Followup-To: comp.unix.programmer Distribution: usa Organization: North Coast Public Access Un*x (ncoast) Lines: 21 As quoted from <1991May1.192004.25227@msuinfo.cl.msu.edu> by burroak@convex.cl.msu.edu (newell franks): +--------------- | I'm having a problem with switch(c) while programming with curses. The keys | don't function as I thought they should. I am by no means an expert C | | c = getch(); | switch(c) { | case KEY_BACKSPACE: | case KEY_DOWN: field ++; +--------------- Dumb question: how did you declare "c"? It should be declared as type "chtype" (declared by curses.h) --- "char" and "unsigned char" are too short, as the special keys are given values greater than 256. ++Brandon -- Me: Brandon S. Allbery Ham: KB8JRR/AA 10m,6m,2m,220,440,1.2 Internet: allbery@NCoast.ORG (restricted HF at present) Delphi: ALLBERY AMPR: kb8jrr.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery KB8JRR @ WA8BXN.OH