(self, event)
| 772 | event.canvas.release_mouse(self.ax) |
| 773 | |
| 774 | def _keypress(self, event): |
| 775 | if self.ignore(event): |
| 776 | return |
| 777 | if self.capturekeystrokes: |
| 778 | key = event.key |
| 779 | |
| 780 | if(len(key) == 1): |
| 781 | self.text = (self.text[:self.cursor_index] + key + |
| 782 | self.text[self.cursor_index:]) |
| 783 | self.cursor_index += 1 |
| 784 | elif key == "right": |
| 785 | if self.cursor_index != len(self.text): |
| 786 | self.cursor_index += 1 |
| 787 | elif key == "left": |
| 788 | if self.cursor_index != 0: |
| 789 | self.cursor_index -= 1 |
| 790 | elif key == "home": |
| 791 | self.cursor_index = 0 |
| 792 | elif key == "end": |
| 793 | self.cursor_index = len(self.text) |
| 794 | elif(key == "backspace"): |
| 795 | if self.cursor_index != 0: |
| 796 | self.text = (self.text[:self.cursor_index - 1] + |
| 797 | self.text[self.cursor_index:]) |
| 798 | self.cursor_index -= 1 |
| 799 | elif(key == "delete"): |
| 800 | if self.cursor_index != len(self.text): |
| 801 | self.text = (self.text[:self.cursor_index] + |
| 802 | self.text[self.cursor_index + 1:]) |
| 803 | |
| 804 | self.text_disp.remove() |
| 805 | self.text_disp = self._make_text_disp(self.text) |
| 806 | self._rendercursor() |
| 807 | self._notify_change_observers() |
| 808 | if key == "enter": |
| 809 | self._notify_submit_observers() |
| 810 | |
| 811 | def set_val(self, val): |
| 812 | newval = str(val) |
nothing calls this directly
no test coverage detected