diff options
author | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1998-01-09 09:06:55 +0000 |
---|---|---|
committer | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1998-01-09 09:06:55 +0000 |
commit | 363f670991cb623fdf9237c312b3100867950ee3 (patch) | |
tree | c4c012c5269daa1f4b5e92d3579e6c84c5ada7fe /sys/isa/syscons.c | |
parent | 98e7f9ea4236222f9dd15c4530fe9bc9f5eff063 (diff) |
- Produce the accent letter if the user hits the accent key twice.
(accent_key + space does still print the accent letter too, as in
the previous commit.)
Requested by a couple of users.
- Clear the accent flag when the next_screen key is pressed.
- Added some comment lines regarding accent key processing.
Notes
Notes:
svn path=/head/; revision=32364
Diffstat (limited to 'sys/isa/syscons.c')
-rw-r--r-- | sys/isa/syscons.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index 85dbdc95acb3..6862fd97a30c 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.242 1997/12/07 08:09:19 yokota Exp $ + * $Id: syscons.c,v 1.243 1998/01/07 08:40:34 yokota Exp $ */ #include "sc.h" @@ -3760,6 +3760,7 @@ next_code: case NEXT: { int next, this = get_scr_num(); + accents = 0; for (next = this+1; next != this; next = (next+1)%MAXCONS) { struct tty *tp = VIRTUAL_TTY(next); if (tp->t_state & TS_ISOPEN) { @@ -3774,11 +3775,30 @@ next_code: return(BKEY); default: if (action >= F_ACC && action <= L_ACC) { - accents = action - F_ACC + 1; - if (accent_map.acc[accents - 1].accchar == 0) { + /* turn it into an index */ + action -= F_ACC - 1; + if ((action > accent_map.n_accs) + || (accent_map.acc[action - 1].accchar == 0)) { + /* + * The index is out of range or pointing to an + * empty entry. + */ accents = 0; do_bell(cur_console, BELL_PITCH, BELL_DURATION); } + /* + * If the same accent key has been hit twice, + * produce the accent char itself. + */ + if (action == accents) { + action = accent_map.acc[accents - 1].accchar; + accents = 0; + if (metas) + action |= MKEY; + return (action); + } + /* remember the index and wait for the next key stroke */ + accents = action; break; } if (accents > 0) { @@ -3801,6 +3821,10 @@ next_code: acc = &accent_map.acc[accents - 1]; accents = 0; + /* + * If the accent key is followed by the space key, + * produce the accent char itself. + */ if (action == ' ') { action = acc->accchar; if (metas) @@ -3808,7 +3832,7 @@ next_code: return (action); } for (i = 0; i < NUM_ACCENTCHARS; ++i) { - if (acc->map[i][0] == 0) + if (acc->map[i][0] == 0) /* end of the map entry */ break; if (acc->map[i][0] == action) { action = acc->map[i][1]; |