Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* curses problem
@ 1990-11-16 21:14 Rebecca Marvil
  0 siblings, 0 replies; 4+ messages in thread
From: Rebecca Marvil @ 1990-11-16 21:14 UTC (permalink / raw)


I have been having trouble porting a program which
uses curses, from a MIPS M-2000 running RISC-OS 4.51 
(Berkeley environment) to a DEC station 3100 running 
Ultrix 4.0.

Throughout the program I use wmove() and waddstr()
to print a string to the specified location in the
specified window.  All of these function calls work
fine on the MIPS, but on the DEC, occasionally the
wmove() will not move the logical cursor where I 
specify, and thus the waddstr() function prints the
string in the wrong location.  This only happens when
the x argument to wmove() is 0, yet it doesn't happen for
all values of y.  In other words, calling wmove(datawin,5,0)
may work just fine, but wmove(datawin,6,0) won't.  When
it doesn't work right, it ALWAYS moves the logical cursor
to the previous line, in the last column.  So, in the above
example, the wmove(datawin,6,0) would put the logical cursor
at (5,79) - assuming the window is 80 columns wide.

NOTE: If I never print anything to the last column of the 
window, the program works fine.

If anyone has any suggestions that might help with this
problem, they would be most appreciated.


Becky Marvil        marvil@boulder.colorado.edu
MCD Biology
Univ. of Colorado
Boulder, CO 80309
303-492-5938


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Curses problem
@ 1993-07-14  1:15 David P Sly
  1993-07-15  3:42 ` John Hascall
  0 siblings, 1 reply; 4+ messages in thread
From: David P Sly @ 1993-07-14  1:15 UTC (permalink / raw)


	I am trying to compile a curses program on DEC3100 (Ultrix 4.2),
using cursesX. The screen comes up fine. But the trouble starts when I
try to use the funtion keys. I just return the key code of the key
pressed and when 'q' is pressed I quit. It works for all alphanumeric keys.
But on pressing, say F1 (KEY_F(1)) I don't get the value 411 ( form the 
header file for curses).

	Can somebody shed light on what I am doing wrong ( or what could be
wrong).

Thanks,



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Curses problem
  1993-07-14  1:15 Curses problem David P Sly
@ 1993-07-15  3:42 ` John Hascall
  1993-07-15 12:11   ` Korben R. Kirscht
  0 siblings, 1 reply; 4+ messages in thread
From: John Hascall @ 1993-07-15  3:42 UTC (permalink / raw)


david_s@iastate.edu (David P Sly) writes:
}	I am trying to compile a curses program on DEC3100 (Ultrix 4.2),
}using cursesX. The screen comes up fine. But the trouble starts when I
}try to use the funtion keys. I just return the key code of the key
}pressed and when 'q' is pressed I quit. It works for all alphanumeric keys.
}But on pressing, say F1 (KEY_F(1)) I don't get the value 411 ( form the 
}header file for curses).
}
}	Can somebody shed light on what I am doing wrong ( or what could be
}wrong).

I believe that `curses F1' is what is labeled `PF1' on the DEC
keyboard -- I don't think curses knows the escape sequences
for the F# keys across the top of the keyboard (you'll have to
decode them yourself).

John
-- 
John Hascall                   ``An ill-chosen word is the fool's messenger.''
Systems Software Engineer
Project Vincent
Iowa State University Computation Center  +  Ames, IA  50011  +  515/294-9551


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Curses problem
  1993-07-15  3:42 ` John Hascall
@ 1993-07-15 12:11   ` Korben R. Kirscht
  0 siblings, 0 replies; 4+ messages in thread
From: Korben R. Kirscht @ 1993-07-15 12:11 UTC (permalink / raw)


In article <CA6szK.Gyx@news.iastate.edu>, john@iastate.edu (John Hascall) writes:
> david_s@iastate.edu (David P Sly) writes:
> }	I am trying to compile a curses program on DEC3100 (Ultrix 4.2),
> }using cursesX. The screen comes up fine. But the trouble starts when I
> }try to use the funtion keys. I just return the key code of the key
> }pressed and when 'q' is pressed I quit. It works for all alphanumeric keys.
> }But on pressing, say F1 (KEY_F(1)) I don't get the value 411 ( form the 
> }header file for curses).
> }
> }	Can somebody shed light on what I am doing wrong ( or what could be
> }wrong).
> 
> I believe that `curses F1' is what is labeled `PF1' on the DEC
> keyboard -- I don't think curses knows the escape sequences
> for the F# keys across the top of the keyboard (you'll have to
> decode them yourself).
> 

/*
   Program  :  read_keystrokes.c
   Author   :  Korben Kirscht
   Site     :  EDS / Unigraphics, Cypress, CA
   Date     :  24-April-1993


   Since the curses keyboard functions do not pass special keys correctly on
   VMS, one must use the SMG Virtual Keyboard routines for getting characters
   from the keyboard.

   This program was designed to test the keyboard and print the integer value
   passed back by the keyboard routines.  This integer value may then be
   associated with a defined value and comparisons may be made within your
   application. (ie. if (keystroke == UP_ARROW) )  Within my application
   programs I make these definitions in a header file named "keydefs.h".
   (see example below)


*/



#include <curses.h>
#include <smgdef.h>
#define bool int




main ()

{



     WINDOW *win1;

     int keyboard,    /*  Pointer to keyboard */ 
         status;      /*  General status field for checking return values  */

     short keystroke; /* Holds key entered on the keyboard */




  /*  Create the virtual keyboard and return the pointer to the keyboard
      into keyboard variable.
  */

     if ( ((status = SMG$CREATE_VIRTUAL_KEYBOARD(&keyboard))&1) !=1 ) return;
  




  /*  Create a basic window.  Nothing is displayed on the window however */

     initscr(); 

     win1 = newwin(15, 10, 5, 5);

     wrefresh(win1);

     refresh();

  


  /*  Read a keystroke from the virtual keyboard  */

  SMG$READ_KEYSTROKE(&keyboard,&keystroke); 

  /*  Within your *REAL* application, you may test the keystroke against 
      defined values from "keydefs.h".

      Example:  if ( keystroke == UP_ARROW ) ...

  */




      endwin(); 





  /*  Print the printable translation of the keystroke and the integer value
      returned from the SMG routine.  The integer value is used in "keydefs.h"
  */

     fprintf(stdout, "\n%c(%d)", keystroke, keystroke );




}
/*

keydefs.h

        Defines       Integer from SMG$SMG$READ_KEYSTROKE



   ...  Stuff deleted  ...

#define BACKSPACE     8
#define UP_ARROW      274
#define DOWN_ARROW    275
#define LEFT_ARROW    276
#define RIGHT_ARROW   277
#define RETURN        13
#define ESCAPE        291
#define TAB           9
#define CTRLW         23



   ...  Stuff deleted  ...

*/


--------------------------------------------------------------------------------
 Korben Kirscht               |  EEEEEE  DDDDDD    SSSSS        UU   UU  GGGGGG
 EDS Unigraphics              |  EE      DD   DD  SS         // UU   UU GG
 10824 Hope Street MS: 1S-135 |  EE      DD   DD  SS        //  UU   UU GG
 Cypress, CA 90630-5099       |  EEEE    DD   DD   SSSS    //   UU   UU GG
                              |  EE      DD   DD      SS  //    UU   UU GG   GG
 Internet: kirscht@ug.eds.com |  EE      DD   DD      SS //     UU   UU GG    G
                              |  EEEEEE  DDDDDD   SSSSS          UUUUU   GGGGGG



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1993-07-15 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1990-11-16 21:14 curses problem Rebecca Marvil
  -- strict thread matches above, loose matches on Subject: below --
1993-07-14  1:15 Curses problem David P Sly
1993-07-15  3:42 ` John Hascall
1993-07-15 12:11   ` Korben R. Kirscht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox