Skip to content

Commit

Permalink
Fix #196: ignore CAPS-LOCK & NUM-LOCK sequences on input.
Browse files Browse the repository at this point in the history
  • Loading branch information
marknu committed Apr 21, 1997
1 parent 6bcb1df commit 2da19e8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
#define EC_B_COMPLETE 18
#define EC_LITERAL 19

#define EC_NOACTION 101
#define EC_UINVALID 102

/* Flags for editchar() */
Expand Down
7 changes: 3 additions & 4 deletions cmdbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ cmd_edit(c)
case EC_EXPAND:
return (cmd_complete(action));
#endif
case EC_NOACTION:
return (CC_OK);
default:
not_in_completion();
return (CC_PASS);
Expand Down Expand Up @@ -1001,10 +1003,7 @@ cmd_char(c)
/*
* Insert the char into the command buffer.
*/
action = cmd_ichar(c);
if (action != CC_OK)
return (action);
return (CC_OK);
return (cmd_ichar(c));
}

/*
Expand Down
2 changes: 2 additions & 0 deletions pckeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
*/
#define PCK_SHIFT_TAB '\017'
#define PCK_ALT_E '\022'
#define PCK_CAPS_LOCK '\072'
#define PCK_F1 '\073'
#define PCK_NUM_LOCK '\105'
#define PCK_HOME '\107'
#define PCK_UP '\110'
#define PCK_PAGEUP '\111'
Expand Down
4 changes: 4 additions & 0 deletions screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ static char kecmdtable[] = {
'\17',0, EC_B_COMPLETE, /* BACKTAB (?) */
'\340',PCK_SHIFT_TAB,0, EC_B_COMPLETE, /* BACKTAB */
'\14',0, EC_EXPAND, /* CTRL-L */
'\340',PCK_CAPS_LOCK,0, EC_NOACTION, /* CAPS LOCK */
'\340',PCK_NUM_LOCK,0, EC_NOACTION, /* NUM LOCK */
0 /* Extra byte to terminate; subtracted from size, below */
};
static int sz_kecmdtable = sizeof(kecmdtable) -1;
Expand All @@ -858,6 +860,8 @@ static char kfcmdtable[] =
'\340',PCK_END,0, A_GOEND, /* END */
'\340',PCK_F1,0, A_HELP, /* F1 */
'\340',PCK_ALT_E,0, A_EXAMINE, /* Alt-E */
'\340',PCK_CAPS_LOCK,0, A_NOACTION, /* CAPS LOCK */
'\340',PCK_NUM_LOCK,0, A_NOACTION, /* NUM LOCK */
0
};
static int sz_kfcmdtable = sizeof(kfcmdtable) - 1;
Expand Down

0 comments on commit 2da19e8

Please sign in to comment.