Sync with sys/i386/isa/syscons.c revision 1.243.
This commit is contained in:
parent
ab29750a7f
commit
e40dd20700
@ -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.66 1997/12/09 11:58:02 kato Exp $
|
||||
* $Id: syscons.c,v 1.67 1998/01/04 09:59:23 kato Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
@ -151,6 +151,7 @@ static int blinkrate = 0;
|
||||
char crtc_type = KD_MONO;
|
||||
char crtc_vga = FALSE;
|
||||
static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0;
|
||||
static u_char accents = 0;
|
||||
#ifdef PC98
|
||||
static u_char nlkcnt = 0, slkcnt = 0, alkcnt = 0;
|
||||
#else
|
||||
@ -743,7 +744,7 @@ sckbdprobe(int unit, int flags)
|
||||
static int
|
||||
scresume(void *dummy)
|
||||
{
|
||||
shfts = ctls = alts = agrs = metas = 0;
|
||||
shfts = ctls = alts = agrs = metas = accents = 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -1986,7 +1987,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
|
||||
|
||||
case K_XLATE: /* switch to XLT ascii mode */
|
||||
if (scp == cur_console && scp->status & KBD_RAW_MODE)
|
||||
shfts = ctls = alts = agrs = metas = 0;
|
||||
shfts = ctls = alts = agrs = metas = accents = 0;
|
||||
scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE);
|
||||
return 0;
|
||||
default:
|
||||
@ -2104,9 +2105,20 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
|
||||
return 0;
|
||||
|
||||
case PIO_KEYMAP: /* set keyboard translation table */
|
||||
accents = 0;
|
||||
bzero(&accent_map, sizeof(accent_map));
|
||||
bcopy(data, &key_map, sizeof(key_map));
|
||||
return 0;
|
||||
|
||||
case GIO_DEADKEYMAP: /* get accent key translation table */
|
||||
bcopy(&accent_map, data, sizeof(accent_map));
|
||||
return 0;
|
||||
|
||||
case PIO_DEADKEYMAP: /* set accent key translation table */
|
||||
accents = 0;
|
||||
bcopy(data, &accent_map, sizeof(accent_map));
|
||||
return 0;
|
||||
|
||||
#ifdef PC98
|
||||
case PIO_FONT8x8: /* set 8x8 dot font */
|
||||
case GIO_FONT8x8: /* get 8x8 dot font */
|
||||
@ -2625,7 +2637,7 @@ exchange_scr(void)
|
||||
#endif
|
||||
if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE ||
|
||||
old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE)
|
||||
shfts = ctls = alts = agrs = metas = 0;
|
||||
shfts = ctls = alts = agrs = metas = accents = 0;
|
||||
set_border(new_scp->border);
|
||||
update_leds(new_scp->status);
|
||||
delayed_next_scr = FALSE;
|
||||
@ -4612,20 +4624,24 @@ scgetc(u_int flags)
|
||||
break;
|
||||
case SPSC:
|
||||
#ifdef SC_SPLASH_SCREEN
|
||||
accents = 0;
|
||||
toggle_splash_screen(cur_console);
|
||||
#endif
|
||||
break;
|
||||
case RBT:
|
||||
accents = 0;
|
||||
shutdown_nice();
|
||||
break;
|
||||
case SUSP:
|
||||
#if NAPM > 0
|
||||
accents = 0;
|
||||
apm_suspend();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case DBG:
|
||||
#ifdef DDB /* try to switch to console 0 */
|
||||
accents = 0;
|
||||
if (cur_console->smode.mode == VT_AUTO &&
|
||||
console[0]->smode.mode == VT_AUTO)
|
||||
switch_scr(cur_console, 0);
|
||||
@ -4671,8 +4687,21 @@ scgetc(u_int flags)
|
||||
}
|
||||
break;
|
||||
case BTAB:
|
||||
accents = 0;
|
||||
return(BKEY);
|
||||
default:
|
||||
if (action >= F_ACC && action <= L_ACC) {
|
||||
accents = action - F_ACC + 1;
|
||||
if (accent_map.acc[accents - 1].accchar == 0) {
|
||||
accents = 0;
|
||||
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (accents > 0) {
|
||||
accents = 0;
|
||||
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
||||
}
|
||||
if (action >= F_SCR && action <= L_SCR) {
|
||||
switch_scr(cur_console, action - F_SCR);
|
||||
break;
|
||||
@ -4683,6 +4712,31 @@ scgetc(u_int flags)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (accents) {
|
||||
struct acc_t *acc;
|
||||
int i;
|
||||
|
||||
acc = &accent_map.acc[accents - 1];
|
||||
accents = 0;
|
||||
if (action == ' ') {
|
||||
action = acc->accchar;
|
||||
if (metas)
|
||||
action |= MKEY;
|
||||
return (action);
|
||||
}
|
||||
for (i = 0; i < NUM_ACCENTCHARS; ++i) {
|
||||
if (acc->map[i][0] == 0)
|
||||
break;
|
||||
if (acc->map[i][0] == action) {
|
||||
action = acc->map[i][1];
|
||||
if (metas)
|
||||
action |= MKEY;
|
||||
return (action);
|
||||
}
|
||||
}
|
||||
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
||||
goto next_code;
|
||||
}
|
||||
if (metas)
|
||||
action |= MKEY;
|
||||
return(action);
|
||||
|
Loading…
Reference in New Issue
Block a user