Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
tty Namespace Reference

Functions

def setraw
 
def setcbreak
 

Variables

list __all__ = ["setraw", "setcbreak"]
 
int IFLAG = 0
 
int OFLAG = 1
 
int CFLAG = 2
 
int LFLAG = 3
 
int ISPEED = 4
 
int OSPEED = 5
 
int CC = 6
 

Detailed Description

Terminal utilities.

Function Documentation

def tty.setcbreak (   fd,
  when = TCSAFLUSH 
)
Put terminal into a cbreak mode.

Definition at line 30 of file tty.py.

30 
31 def setcbreak(fd, when=TCSAFLUSH):
32  """Put terminal into a cbreak mode."""
33  mode = tcgetattr(fd)
34  mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
35  mode[CC][VMIN] = 1
36  mode[CC][VTIME] = 0
37  tcsetattr(fd, when, mode)
def tty.setraw (   fd,
  when = TCSAFLUSH 
)
Put terminal into a raw mode.

Definition at line 18 of file tty.py.

18 
19 def setraw(fd, when=TCSAFLUSH):
20  """Put terminal into a raw mode."""
21  mode = tcgetattr(fd)
22  mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
23  mode[OFLAG] = mode[OFLAG] & ~(OPOST)
24  mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB)
25  mode[CFLAG] = mode[CFLAG] | CS8
26  mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG)
27  mode[CC][VMIN] = 1
28  mode[CC][VTIME] = 0
29  tcsetattr(fd, when, mode)

Variable Documentation

list __all__ = ["setraw", "setcbreak"]

Definition at line 7 of file tty.py.

int CC = 6

Definition at line 16 of file tty.py.

int CFLAG = 2

Definition at line 12 of file tty.py.

int IFLAG = 0

Definition at line 10 of file tty.py.

int ISPEED = 4

Definition at line 14 of file tty.py.

int LFLAG = 3

Definition at line 13 of file tty.py.

int OFLAG = 1

Definition at line 11 of file tty.py.

int OSPEED = 5

Definition at line 15 of file tty.py.