Skip to content
Snippets Groups Projects
term.c 30.4 KiB
Newer Older
					break;
				case CIO_KEY_F(3):
					conn_send("\033Ow",3,0);
					break;
				case CIO_KEY_F(4):
					conn_send("\033Ox",3,0);
					break;
				case 0x3000:	/* ALT-B - Scrollback */
#ifdef PCM
					if(!confirm("View scrollback?",NULL))
						continue;
#endif
					viewscroll();
					showmouse();
					break;
				case 0x2e00:	/* ALT-C - Capture */
#ifdef PCM
					if(!confirm("Go to capture control menu?",NULL))
						continue;
#endif
					capture_control(bbs);
					showmouse();
					break;
				case 0x2000:	/* ALT-D - Download */
#ifdef PCM
					if(!confirm("Begin download?",NULL))
						continue;
#endif
					zmodem_download(bbs->dldir);
					showmouse();
#ifdef PCM
					if(!confirm("Go to font control menu?",NULL))
						continue;
#endif
					showmouse();
#ifdef PCM
					if(!confirm("Send login credentials?",NULL))
						continue;
#endif
					conn_send(bbs->user,strlen(bbs->user),0);
					conn_send("\r",1,0);
					SLEEP(10);
					conn_send(bbs->password,strlen(bbs->password),0);
					conn_send("\r",1,0);
					if(bbs->syspass[0]) {
						SLEEP(10);
						conn_send(bbs->syspass,strlen(bbs->syspass),0);
						conn_send("\r",1,0);
					}
deuce's avatar
deuce committed
				case 0x3200:	/* ALT-M */
#ifdef PCM
					if(!confirm("Go to music control menu?",NULL))
						continue;
#endif
deuce's avatar
deuce committed
					music_control(bbs);
					showmouse();
deuce's avatar
deuce committed
					break;
				case 0x1600:	/* ALT-U - Upload */
#ifdef PCM
					if(!confirm("Begin upload?",NULL))
						continue;
#endif
					begin_upload(bbs->uldir, FALSE);
					showmouse();
deuce's avatar
deuce committed
				case 17:		/* CTRL-Q */
					if(cio_api.mode!=CIOLIB_MODE_CURSES
							&& cio_api.mode!=CIOLIB_MODE_CURSES_IBM
							&& cio_api.mode!=CIOLIB_MODE_ANSI) {
						ch[0]=key;
						conn_send(ch,1,0);
						break;
					}
					/* FALLTHROUGH for curses/ansi modes */
				case 0x2d00:	/* Alt-X - Exit */
				case 0x2300:	/* Alt-H - Hangup */
deuce's avatar
deuce committed
					{
						char *opts[3]={
										 "Yes"
										,"No"
										,""
									  };
						char *buf;
						struct	text_info txtinfo;

    					gettextinfo(&txtinfo);
						buf=(char *)malloc(txtinfo.screenheight*txtinfo.screenwidth*2);
						gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
						i=0;
deuce's avatar
deuce committed
						if(uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,NULL,"Disconnect... Are you sure?",opts)==0) {
							uifcbail();
							free(buf);
							cterm_write("\x0c",1,NULL,0,NULL);	/* Clear screen into scrollback */
							scrollback_lines=cterm.backpos;
deuce's avatar
deuce committed
							cterm_end();
							conn_close();
							hidemouse();
							return(key==0x2d00 /* Alt-X? */);
deuce's avatar
deuce committed
						}
						uifcbail();
						puttext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
						window(txtinfo.winleft,txtinfo.wintop,txtinfo.winright,txtinfo.winbottom);
						textattr(txtinfo.attribute);
						gotoxy(txtinfo.curx,txtinfo.cury);
						free(buf);
						showmouse();
deuce's avatar
deuce committed
					}
					break;
					if(cio_api.mode!=CIOLIB_MODE_CURSES
							&& cio_api.mode!=CIOLIB_MODE_CURSES_IBM
							&& cio_api.mode!=CIOLIB_MODE_ANSI) {
						ch[0]=key;
						conn_send(ch,1,0);
						break;
					}
					/* FALLTHROUGH for curses/ansi modes */
				case 0x2c00:		/* ALT-Z */
					switch(syncmenu(bbs, &speed)) {
#ifdef PCM
							if(!confirm("Disconnect?",NULL))
								continue;
#endif
							cterm_write("\x0c",1,NULL,0,NULL);	/* Clear screen into scrollback */
							scrollback_lines=cterm.backpos;
							conn_close();
							hidemouse();
							return(FALSE);
						case 3:
#ifdef PCM
							if(!confirm("Begin upload?",NULL))
								continue;
#endif
							begin_upload(bbs->uldir, FALSE);
#ifdef PCM
							if(!confirm("Begin download?",NULL))
								continue;
#endif
							zmodem_download(bbs->dldir);
#ifdef PCM
							if(!confirm("Got to capture control menu?",NULL))
								continue;
#endif
							capture_control(bbs);
							break;
						case 8:
#ifdef PCM
							if(!confirm("Go to music control menu?",NULL))
								continue;
#endif
deuce's avatar
deuce committed
							music_control(bbs);
							break;
						case 9:
#ifdef PCM
							if(!confirm("Go to font control menu?",NULL))
								continue;
#endif
#ifdef PCM
							if(!confirm("Disconnect?",NULL))
								continue;
#endif
							cterm_write("\x0c",1,NULL,0,NULL);	/* Clear screen into scrollback */
							scrollback_lines=cterm.backpos;
							cterm_end();
							conn_close();
							hidemouse();
					showmouse();
				case 0x9800:	/* ALT-Up */
#ifdef PCM
					if(!confirm("Increase simulated BPS rate?",NULL))
						continue;
#endif
					if(speed)
						speed=rates[get_rate_num(speed)+1];
					else
						speed=rates[0];
					break;
				case 0xa000:	/* ALT-Down */
#ifdef PCM
					if(!confirm("Decrease simulated BPS rate?",NULL))
						continue;
#endif
					i=get_rate_num(speed);
					if(i==0)
						speed=0;
					else
						speed=rates[i-1];
					break;
				case '\b':
					key='\b';
					/* FALLTHROUGH to default */
				default:
					if(key<256) {
						ch[0]=key;
						conn_send(ch,1,0);
deuce's avatar
deuce committed
		if(sleep)
deuce's avatar
deuce committed
			SLEEP(1);
		else
			MAYBE_YIELD();
	hidemouse();
	return(FALSE);