From e884d2cbfad9198f0202c2f8da70b1f773f172f1 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 3 Nov 2009 12:47:23 +0000 Subject: [PATCH] make the delete key work in the console ui --- ChangeLog | 1 + deluge/ui/console/screen.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6e177c115..564c42427 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ ==== Console ==== * Escape hyphens in the manpage + * Make the delete key work === Deluge 1.2.0_rc3 (01 November 2009) === ==== Core ==== diff --git a/deluge/ui/console/screen.py b/deluge/ui/console/screen.py index 456db950b..70c5520de 100644 --- a/deluge/ui/console/screen.py +++ b/deluge/ui/console/screen.py @@ -381,12 +381,18 @@ class Screen(CursesStdIO): self.display_lines_offset = 0 self.refresh() + open("/tmp/key_logger", "a").write(str(c) + "\n") + # Delete a character in the input string based on cursor position if c == curses.KEY_BACKSPACE or c == 127: if self.input and self.input_cursor > 0: self.input = self.input[:self.input_cursor - 1] + self.input[self.input_cursor:] self.input_cursor -= 1 + elif c == curses.KEY_DC or c == 51: + if self.input and self.input_cursor < len(self.input): + self.input = self.input[:self.input_cursor] + self.input[self.input_cursor + 1:] + # A key to add to the input string else: if c > 31 and c < 127: