def on_key_up(self):
if (self.last_pressed is not None):<EOL><INDENT>self.set_key_state(self.last_pressed, <NUM_LIT:0>)<EOL>self.buffer = self.last_pressed.update_buffer(self.buffer)<EOL>self.text_consumer(self.buffer)<EOL>self.last_pressed = None<EOL><DEDENT>
Process key up event by updating buffer and release key.