Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!lll-tis!ptsfa!pbhyf!pjc From: pjc@pbhyf.UUCP (Paul Condie) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: sun function keys Message-ID: <2273@pbhyf.UUCP> Date: Thu, 29-Oct-87 15:08:08 EST Article-I.D.: pbhyf.2273 Posted: Thu Oct 29 15:08:08 1987 Date-Received: Wed, 4-Nov-87 01:11:59 EST Organization: Pacific * Bell, San Ramon, CA Lines: 58 Xref: mnetor comp.unix.questions:4715 comp.unix.wizards:5196 /* ** Help on how to program the suns' function keys??? */ #include #include #include #include #include main () { char ch; int fd; initscr (); cbreak (); noecho (); nonl (); keypad (stdscr, TRUE); fd = open ("/dev/kbd", 0, 0); /* set the up arrow */ /* this works */ set_key (fd, 69, "uparrow", STRING+UPARROW); /* set F4 */ /* this doesn't work */ /* H E L P - why doesn't this work ? */ set_key (fd, 3, "hello", STRING+TF(4)); close (fd); while (ch != '9') { ch = getch (); printf ("\n:%d: :%c:", ch, ch); } endwin (); } set_key(fd, station, value, count) int fd, station, count ; char value[80] ; { struct kiockey key ; key.kio_tablemask = 0 ; key.kio_entry = count ; key.kio_station = station ; strcpy (key.kio_string,value) ; ioctl (fd,(int) KIOCSETKEY,(char *) &key) ; }