home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
APPS
/
elm.lzh
/
ELM
/
SRC
/
SOFTKEYS.C
< prev
next >
Wrap
Text File
|
1991-01-11
|
3KB
|
135 lines
static char rcsid[] = "@(#)$Id: softkeys.c,v 4.1 90/04/28 22:44:11 syd Exp $";
/*******************************************************************************
* The Elm Mail System - $Revision: 4.1 $ $State: Exp $
*
* Copyright (c) 1986, 1987 Dave Taylor
* Copyright (c) 1988, 1989, 1990 USENET Community Trust
*******************************************************************************
* Bug reports, patches, comments, suggestions should be sent to:
*
* Syd Weinstein, Elm Coordinator
* elm@DSI.COM dsinc!elm
*
*******************************************************************************
* $Log: softkeys.c,v $
* Revision 4.1 90/04/28 22:44:11 syd
* checkin of Elm 2.3 as of Release PL0
*
*
*******************************************************************************
*/
#include "headers.h"
define_softkeys(level)
int level;
{
if (! hp_softkeys) return;
if (level == MAIN) {
define_key(f1, " Display Msg", "\r");
define_key(f2, " Mail Msg", "m");
define_key(f3, " Reply to Msg", "r");
if (user_level == 0) {
define_key(f4, " Save Msg", "s");
define_key(f5, " Delete Msg", "d");
define_key(f6, "Undelete Msg", "u");
}
else {
define_key(f4, " Change Folder", "c");
define_key(f5, " Save Msg", "s");
define_key(f6, " Delete/Undelete", "^");
}
define_key(f7, " Print Msg", "p");
define_key(f8, " Quit ELM", "q");
}
else if (level == ALIAS) {
define_key(f1, " Alias Current", "a");
define_key(f2, " Check Person", "p");
define_key(f3, " Check System", "s");
define_key(f4, " Make Alias", "m");
clear_key(f5);
clear_key(f6);
clear_key(f7);
define_key(f8, " Return to ELM", "r");
}
else if (level == YESNO) {
define_key(f1, " Yes", "y");
clear_key(f2);
clear_key(f3);
clear_key(f4);
clear_key(f5);
clear_key(f6);
clear_key(f7);
define_key(f8, " No", "n");
}
else if (level == READ) {
define_key(f1, " Next Page ", " ");
clear_key(f2);
define_key(f3, " Next Msg ", "j");
define_key(f4, " Prev Msg ", "k");
define_key(f5, " Reply to Msg ", "r");
define_key(f6, " Delete Msg ", "d");
define_key(f7, " Send Msg ", "m");
define_key(f8, " Return to ELM ", "q");
}
else if (level == CHANGE) {
define_key(f1, " Mail Directry", "=/");
define_key(f2, " Home Directry", "~/");
clear_key(f3);
define_key(f4, "Incoming Mailbox", "!\n");
define_key(f5, "\"Received\" Folder", ">\n");
define_key(f6, "\"Sent\" Folder ", "<\n");
clear_key(f7);
define_key(f8, " Cancel", "\n");
}
softkeys_on();
}
define_key(key, display, send)
int key;
char *display, *send;
{
char buffer[30];
sprintf(buffer,"%s%s", display, send);
fprintf(stdout, "%c&f%dk%dd%dL%s", ESCAPE, key,
strlen(display), strlen(send), buffer);
fflush(stdout);
}
softkeys_on()
{
/* turn on softkeys (esc&jB) and turn on MENU
and USER/SYSTEM options. */
if (hp_softkeys) {
fprintf(stdout, "%c&s1A%c&jB%c&jR", ESCAPE, ESCAPE, ESCAPE);
fflush(stdout);
}
}
softkeys_off()
{
if (hp_softkeys) {
fprintf(stdout, "%c&jA", ESCAPE);
fflush(stdout);
}
}
clear_key(key)
{
/** set a key to nothing... **/
if (hp_softkeys)
define_key(key, " ", "");
}