 		
 		keyboard_type = proxy.keyboardType!
 		
-		getKeyboardType()
-		
-		if let _ = proxy.documentContextBeforeInput
-		{
-			if isAllowFullAccess == true
-			{
-				
-			}
-			
-		}
-		else
-		{
+        if proxy.documentContextBeforeInput == nil {
 			sug_word = " "
-			
 		}
 		
 		dispatch_async(dispatch_get_main_queue(), {

		
		switch (height) {
		case 480:
			deviceType = TTDeviceType.TTDeviceTypeIPhone4 ;
			break;
			
		case 568:
			deviceType = TTDeviceType.TTDeviceTypeIPhone5 ;
			break;
		case 667:
			deviceType = TTDeviceType.TTDeviceTypeIPhone6 ;
			break;
		case 736:
			deviceType = TTDeviceType.TTDeviceTypeIPhone6p ;
			break;
			
		default:
			break;
		}
		
		return deviceType
		
	}
	
	func getInputOption(strChar : String) -> [String]
	{
		
		if strChar == "A"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["A","Á","À","Ä","Â","Ã","Å","Æ","Ā"] //"ª", "Ą"
			}
			else
			{
				return ["a","á", "à", "ä", "â", "ã", "å", "æ","ā"] //"ą"
			}
			
		}
		else if strChar == "."
		{
			
			return [".com",".edu",".net",".org"] //"ą
			
		}
		else if strChar == "E"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["E","É","È","Ë","Ê","Ę","Ė","Ē"]
			}
			else
			{
				return ["e", "é", "è", "ë", "ê", "ę", "ė", "ē"]
			}
			
		}
		else if strChar == "U"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["U","Ú","Ü","Ù","Û"]
			}
			else
			{
				return ["u", "ú", "ü", "ù", "û", "ū"]
			}
			
		}
		else if strChar == "I"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["I","Í","Ï","Ì","Î","Į","Ī"]
			}
			else
			{
				return ["i", "í", "ï", "ì", "î", "į", "ī"]
			}
			
		}
		else if strChar == "O"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["O","Ó","Ò","Ö","Ô","Õ","Ø","Œ","Ō"] //"º"
			}
			else
			{
				return ["o", "ó", "ò", "ö", "ô", "õ", "ø", "œ", "ō"]
			}
			
		}
		else if strChar == "S"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["S","Š"]
			}
			else
			{
				return ["s","š"]
			}
			
		}
		else if strChar == "D"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["D","Đ"]
			}
			else
			{
				return ["d", "đ"]
			}
			
		}
		else if strChar == "C"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["C","Ç","Ć","Č"]
			}
			else
			{
				return ["c", "ç", "ć", "č"]
			}
			
		}
		else if strChar == "N"
		{
			if self.shiftState == .Enabled || self.shiftState == .Locked
			{
				return ["N","Ñ","Ń"]
			}
			else
			{
				return ["n","ñ", "ń"]
			}
			
		}
		return [""]
	}

	func getKeyboardType()
	{
		let proxy = textDocumentProxy
		
		if proxy.keyboardType == UIKeyboardType.EmailAddress
		{
			//add code here to display number/decimal input keyboard
			key_type = true
			
		}
		else if(proxy.keyboardType == UIKeyboardType.WebSearch)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.ASCIICapable)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.NumbersAndPunctuation)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.URL)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.NumberPad)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.DecimalPad)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.NamePhonePad)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.Twitter)
		{
			key_type = true
		}
		else if(proxy.keyboardType == UIKeyboardType.Default)
		{
			
			if(proxy.autocorrectionType == UITextAutocorrectionType.No)
			{
				key_type = true
			}
			else
			{
				key_type = false
			}
			
		}
		else
		{
			key_type = false
		}
		
	}

	
}

            }
            
            // auto period on double space
            self.handleAutoPeriod(model)

            // TODO: reset context
        }
        
