def calculate_input(self, buffer):
<EOL>if TriggerMode.ABBREVIATION in self.modes:<EOL><INDENT>if self._should_trigger_abbreviation(buffer):<EOL><INDENT>if self.immediate:<EOL><INDENT>return len(self._get_trigger_abbreviation(buffer))<EOL><DEDENT>else:<EOL><INDENT>return len(self._get_trigger_abbreviation(buffer)) + <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>if TriggerMode.HOTKEY in self.modes:<EOL><INDENT>if buffer == '<STR_LIT>':<EOL><INDENT>return len(self.modifiers) + <NUM_LIT:1><EOL><DEDENT><DEDENT>return self.parent.calculate_input(buffer)<EOL>
Calculate how many keystrokes were used in triggering this phrase.