def on_keydown(self, event):
        """ Internal keydown handler. Processes the special keys, and if none are
        present, redirects the event """
        key_name = event.message
        if key_name == "backspace":
            self._value = self._value[:max(0, self._cursor_index - 1)] + self._value[self._cursor_index:]
            self.cursor_pos -= 1
            self.trigger_event("changed", self._value)
        elif key_name == "delete":
            post_value = self._value[min(len(self._value), self._cursor_index + 1):]
            self._value = self._value[:self._cursor_index] + post_value
            self.cursor_pos = self._cursor_index
            self.trigger_event("changed", self._value)
        elif key_name == "arrow_left":
            if event.get_modifier_state("alt") or event.get_modifier_state("ctrl"):
                self.cursor_skip_left()
            else:
                self.cursor_pos -= 1
        elif key_name == "arrow_right":
            if event.get_modifier_state("alt") or event.get_modifier_state("ctrl"):
                self.cursor_skip_right()
            else:
                self.cursor_pos += 1
        elif key_name == "escape":
            self.blur()
        elif key_name == "home":
            self.cursor_pos = 0
        elif key_name == "end":
            self.cursor_pos = len(self.value)

        self.trigger_event(key_name, self._value)