#NEWLINE# def getKeys( self , fast = False ) : #NEWLINE# #INDENT# 'thanks to some keys not being available, e.g. colon, we return an array of keycodes (int) or strings.' #NEWLINE# r = [ ] #NEWLINE# count = 0 #NEWLINE# for c in self . string_data : #NEWLINE# #INDENT# count += 1 #NEWLINE# if ( fast in self . trouble ) : #NEWLINE# #INDENT# t = self . translate ( c ) #NEWLINE# r . append ( t ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not fast ) and ( count > 7 ) and isinstance ( r [ ( - 1 ) ] , str ) and ( len ( r [ ( - 1 ) ] ) > 7 ) ) : #NEWLINE# #INDENT# r . append ( c ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == '"' ) : #NEWLINE# #INDENT# c = '\\\\\\"' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( sys . platform == 'win32' ) and ( c == '>' ) ) : #NEWLINE# #INDENT# if ( ( len ( r ) > 0 ) and isinstance ( r [ ( - 1 ) ] , str ) and ( '"' in r [ ( - 1 ) ] ) ) : #NEWLINE# #INDENT# c = '\\^>' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# c = '\\>' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( sys . platform == 'win32' ) and ( c == '^' ) ) : #NEWLINE# #INDENT# c = '^^' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c in self . inconvenience ) : #NEWLINE# #INDENT# c = ( '\\' + c ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( len ( r ) > 0 ) and isinstance ( r [ ( - 1 ) ] , str ) and ( r [ ( - 1 ) ] [ ( - 1 ) ] != '$' ) ) : #NEWLINE# #INDENT# r [ ( - 1 ) ] += c #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# r . append ( c ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# r = itertools . chain . from_iterable ( ( ( ( '?a' , 67 ) if ( item == '?' ) else ( item , ) ) for item in r ) ) #NEWLINE# return r