
    .:iZ                     <    S SK r S SKrSSKJr  S\4S jrS\4S jrg)    N   )configreturnc                  f   [         R                  R                  5       n [        R                  " U 5      n[        R                  " U 5      n US==   [        R
                  [        R                  -  [        R                  -  [        R                  -  ) -  ss'   [        R                  " U [        R                  U5        [         R                  R                  S5      n[        R                  " U [        R                  U5        U$ ! [        R                  " U [        R                  U5        f = f)zVReads a single character from the input stream.
Blocks until a character is available.   r   )sysstdinfilenotermios	tcgetattrICANONECHOIGNBRKBRKINT	tcsetattr	TCSAFLUSHread	TCSADRAIN)fdold_settingstermchs       N/home/james-whalen/.local/lib/python3.13/site-packages/readchar/_posix_read.pyreadcharr      s     
			B$$R(LR D?QW^^gll2W^^CgnnTUU"g//6YY^^A"g//>I 	"g//>s   BD (D0c                     [        5       n U [        R                  ;   a  [        eU S:w  a  U $ [        5       nUS;  a  X-   $ [        5       nUS;  a  X-   U-   $ [        5       nUS;  a
  X-   U-   U-   $ [        5       nX-   U-   U-   U-   $ )zqGet a keypress. If an escaped key is pressed, the full sequence is
read and returned as noted in `_posix_key.py`.zO[1235601345789)r   r   INTERRUPT_KEYSKeyboardInterrupt)c1c2c3c4c5s        r   readkeyr&      s     
B	V"""	V|		B	w	B	''w|	B	33w|b  	B7R<"r!!    )r   r   _configr   strr   r&    r'   r   <module>r+      s&    
  # "" "r'   