Updated tty.c
This commit is contained in:
parent
7bafa9cf52
commit
38c6705564
22
src/tty.c
22
src/tty.c
|
@ -1,4 +1,5 @@
|
|||
#include<termios.h>
|
||||
#include<sys/ioctl.h>
|
||||
|
||||
struct termios oldSettings;
|
||||
|
||||
|
@ -23,10 +24,31 @@ void startTTY()
|
|||
|
||||
/* Set the tty to raw mode */
|
||||
tcsetattr(0, 0, &termy);
|
||||
|
||||
|
||||
testicle();
|
||||
}
|
||||
|
||||
void testicle()
|
||||
{
|
||||
/* window size struct */
|
||||
struct winsize size;
|
||||
|
||||
/* IOCTL the vnode via the fd that points to it */
|
||||
ioctl(0, TIOCGWINSZ, &size);
|
||||
|
||||
printf("row: %u\n", size.ws_row);
|
||||
printf("col: %u\n", size.ws_col);
|
||||
}
|
||||
|
||||
void stopTTY()
|
||||
{
|
||||
/* Restore the tty settings back to the original */
|
||||
tcsetattr(0, 0, &oldSettings);
|
||||
}
|
||||
|
||||
|
||||
void setCursor(int x, int y, struct TTY* tty)
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in New Issue