Skip to content

Commit 554ab1a

Browse files
committed
implement kb_init and kb_free to switch the console to and from graphics mode.
1 parent 0750af2 commit 554ab1a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

platforms/unix/vm-display-fbdev/sqUnixEvdevKeyMouse.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*
3838
*/
3939

40+
#include <sys/kd.h>
4041
#include <string.h>
4142
#include <unistd.h>
4243
#include <stdlib.h>
@@ -508,12 +509,20 @@ static void kb_bell(struct kb *kbdSelf)
508509

509510
static void kb_initGraphics(struct kb *kbdSelf)
510511
{
511-
/* NoOp */
512+
if (ioctl( 0, KDSETMODE, KD_GRAPHICS))
513+
{
514+
fprintf(stderr,"Could not set console to KD_GRAPHICS mode.\n");
515+
exit(1);
516+
}
512517
}
513518

514519
static void kb_freeGraphics(struct kb *kbdSelf)
515520
{
516-
/* NoOp */
521+
if (ioctl( 0, KDSETMODE, KD_TEXT))
522+
{
523+
fprintf(stderr,"Could not set console to KD_TEXT mode.\n");
524+
exit(1);
525+
}
517526
}
518527

519528

0 commit comments

Comments
 (0)