* fhandler_console.c (fhandler_console::read): Record the state of the SHIFT,

CTRL and ALT keys at the time of the last keyboard input event.
(fhandler_console::ioctl): Handle requests to retrieve the keyboard modifiers
via the TIOCLINUX command.
* fhandler_tty.c (fhandler_tty_slave::read): Ditto.
* include/sys/termios.h (TIOCLINUX): New macro definition.
This commit is contained in:
Christopher Faylor
2003-09-27 02:36:50 +00:00
parent ecc28ff8db
commit 63726a5eb4
4 changed files with 54 additions and 2 deletions

View File

@@ -1028,6 +1028,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
{
case TIOCGWINSZ:
case TIOCSWINSZ:
case TIOCLINUX:
break;
case FIONBIO:
set_nonblocking (*(int *) arg);
@@ -1071,6 +1072,21 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
WaitForSingleObject (ioctl_done_event, INFINITE);
}
break;
case TIOCLINUX:
int val = * (unsigned char *) arg;
if (val == 6 && ioctl_request_event && ioctl_done_event)
{
get_ttyp ()->arg.value = val;
SetEvent (ioctl_request_event);
WaitForSingleObject (ioctl_done_event, INFINITE);
* (unsigned char *) arg = get_ttyp ()->arg.value & 0xFF;
}
else
{
get_ttyp ()->ioctl_retval = -1;
set_errno (EINVAL);
}
break;
}
release_output_mutex ();