From cf8dee5043a6b6593de2fdb5d1b57a59b46ebd27 Mon Sep 17 00:00:00 2001
From: piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Wed, 8 Jun 2005 12:54:15 +0000
Subject: towards new experience: Fn Key Bindings, a trial.

git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2807 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 mbbsd/edit.c  | 19 +++++++++++++++----
 mbbsd/pmore.c | 11 ++++++-----
 2 files changed, 21 insertions(+), 9 deletions(-)

(limited to 'mbbsd')

diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 124d7d71..f0aa77e1 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -405,10 +405,11 @@ edit_msg(void)
 
     move(b_lines, 0);
     clrtoeol();
-    prints(ANSI_COLOR(37;44) " �s��峹 " ANSI_COLOR(31;47) " (^Z)" ANSI_COLOR(30) "���� "
-	    ANSI_COLOR(31;47) "(^P)" ANSI_COLOR(30) "�Ÿ� "
-	    ANSI_COLOR(31;47) "(^G)" ANSI_COLOR(30) "���J�Ϥ�w " ANSI_COLOR(31) "(^X,^Q)"
-	    ANSI_COLOR(30) "���}��%s�x%c%c%c%c�� %3d:%3d " ANSI_RESET,
+    prints( ANSI_COLOR(37;44) " �s��峹 " 
+	    ANSI_COLOR(31;47) " (^Z/F1)" ANSI_COLOR(30) "���� "
+	    ANSI_COLOR(31;47) "(^P/^G)" ANSI_COLOR(30) "���J�Ÿ�/�Ϥ� "
+	    ANSI_COLOR(31) "(^X/^Q)" ANSI_COLOR(30) "���}"
+	    "��%s�x%c%c%c%c�� %3d:%3d " ANSI_RESET,
 	    curr_buf->insert_mode ? "���J" : "���N",
 	    curr_buf->ansimode ? 'A' : 'a',
 	    curr_buf->indent_mode ? 'I' : 'i',
@@ -2618,6 +2619,7 @@ vedit(char *fpath, int saveheader, int *islocal)
 		}
 
 	    switch (ch) {
+	    case KEY_F10:
 	    case Ctrl('X'):	/* Save and exit */
 		tmp = write_file(fpath, saveheader, islocal);
 		if (tmp != KEEP_EDITING) {
@@ -2633,6 +2635,13 @@ vedit(char *fpath, int saveheader, int *islocal)
 		curr_buf->oldcurrline = curr_buf->currline;
 		curr_buf->redraw_everything = YEA;
 		break;
+	    case KEY_F5:
+		prompt_goto_line();
+		break;
+	    case KEY_F8:
+		t_users();
+		curr_buf->redraw_everything = YEA;
+		break;
 	    case Ctrl('W'):
 		block_cut();
 		// curr_buf->oldcurrline is freed in block_cut, and currline is
@@ -2758,6 +2767,7 @@ vedit(char *fpath, int saveheader, int *islocal)
 		break;
 #endif
 	    case Ctrl('S'):
+	    case KEY_F3:
 		search_str(0);
 		break;
 	    case Ctrl('U'):
@@ -2822,6 +2832,7 @@ vedit(char *fpath, int saveheader, int *islocal)
                 curr_buf->redraw_everything = YEA;
 		break;
 
+	    case KEY_F1:
 	    case Ctrl('Z'):	/* Help */
 		more("etc/ve.hlp", YEA);
 		curr_buf->redraw_everything = YEA;
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index ea100416..e3ec9c05 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -1417,7 +1417,7 @@ static const char    * const pmore_help[] = {
     "(k/��) (j/��/Enter)   �W��/�U���@��",
     "(^B)(PgUp)(BackSpace) �W���@��",
     "(^F)(PgDn)(Space)(��) �U���@��",
-    "(,/</S-Tab)(./>/TAB)  ��/�k����",
+    "(,/</S-TAB)(./>/TAB)  ��/�k����",
     "(0/g/Home) ($/G/End)  �ɮ׶}�Y/����",
     "(;/:)                 ���ܬY��/�Y��",
     "�Ʀr�� 1-9            ���ܿ�J�����ƩΦ渹",
@@ -1432,7 +1432,7 @@ static const char    * const pmore_help[] = {
     "(\\)                   ������ܭ�l���e", // this IS already aligned!
     "(w/W/l)               �����۰ʧ��/���Ÿ�/���j�u��ܤ覡",
     "(p/o)                 ����ʵe/�����DzμҦ�(���A�C�P���覡)",
-    "(q/��) (h/H/?)        ����/�������e��",
+    "(q/��) (h/H/?/F1)     ����/�������e��",
 #ifdef DEBUG
     "(d)                   ��������(debug)�Ҧ�",
 #endif
@@ -1888,9 +1888,10 @@ pmore(char *fpath, int promptend)
 		//if(mf.xpos == 0 || mf.trunclines)
 		    mf.xpos = (mf.xpos/8+1)*8;
 		break;
-	    case 'Z':
-	    case '<':
 		/* acronym form shift-tab, ^[[Z */
+		/* however some terminals does not send that. */
+	    case KEY_STAB:
+	    case '<':
 		mf.xpos = (mf.xpos/8-1)*8;
 		if(mf.xpos < 0) mf.xpos = 0;
 		break;
@@ -2028,7 +2029,7 @@ pmore(char *fpath, int promptend)
 		}
 		break;
 
-	    case 'h': case 'H':
+	    case 'h': case 'H': case KEY_F1:
 	    case '?':
 		// help
 		show_help(pmore_help);
-- 
cgit v1.2.3