<s> """<STR_LIT>""" <EOL> import vim <EOL> class Input : <EOL> def __init__ ( self ) : <EOL> self . _reset ( ) <EOL> def _reset ( self ) : <EOL> """<STR_LIT>""" <EOL> self . LEFT = self . RIGHT = self . UP = self . DOWN = None <EOL> self . RETURN = self . ESC = self . TAB = self . CTRL = self . BS = None <EOL> self . INTERRUPT = self . MOUSE = self . MAC_CMD = None <EOL> self . CHAR = "<STR_LIT>" <EOL> self . F1 = self . F2 = self . F3 = self . F4 = self . F5 = self . F6 = None <EOL> self . F7 = self . F8 = self . F9 = self . F10 = self . F11 = self . F12 = None <EOL> vim . command ( "<STR_LIT>" ) <EOL> vim . command ( "<STR_LIT>" ) <EOL> def get ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _reset ( ) <EOL> vim . command ( """<STR_LIT>""" ) <EOL> if vim . eval ( '<STR_LIT>' ) == '<STR_LIT:1>' : <EOL> self . CTRL = True <EOL> self . CHAR = unicode ( "<STR_LIT:c>" , "<STR_LIT:utf-8>" ) <EOL> self . INTERRUPT = True <EOL> return <EOL> raw_char = vim . eval ( '<STR_LIT>' ) <EOL> if raw_char . startswith ( "<STR_LIT>" ) : <EOL> self . MAC_CMD = True <EOL> char = raw_char . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> nr = vim . eval ( "<STR_LIT>" . format ( char ) ) <EOL> else : <EOL> nr = int ( vim . eval ( "<STR_LIT>" . format ( raw_char ) ) ) <EOL> if nr != <NUM_LIT:0> : <EOL> if nr == <NUM_LIT> : <EOL> self . RETURN = True <EOL> elif nr == <NUM_LIT> : <EOL> self . ESC = True <EOL> elif nr == <NUM_LIT:9> : <EOL> self . TAB = True <EOL> elif <NUM_LIT:1> <= nr <= <NUM_LIT> : <EOL> self . CTRL = True <EOL> self . CHAR = vim . eval ( "<STR_LIT>" . format ( nr + <NUM_LIT> ) ) . decode ( '<STR_LIT:utf-8>' ) <EOL> else : <EOL> self . CHAR = vim . eval ( "<STR_LIT>" . format ( nr ) ) . decode ( '<STR_LIT:utf-8>' ) <EOL> else : <EOL> c = raw_char . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if c == '<STR_LIT>' : <EOL> self . LEFT = True <EOL> elif c == '<STR_LIT>' : <EOL> self . RIGHT = True <EOL> elif c == '<STR_LIT>' : <EOL> self . UP = True <EOL> elif c == '<STR_LIT>' : <EOL> self . DOWN = True <EOL> elif c == '<STR_LIT>' : <EOL> self . BS = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F1 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F2 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F3 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F4 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F5 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F6 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F7 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F8 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F9 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F10 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F11 = True <EOL> elif c == '<STR_LIT>' : <EOL> self . F12 = True <EOL> else : <EOL> self . MOUSE = True </s>
