From c267c36b7ba66313550b9d9522eeaedafc015436 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 27 Apr 2009 17:17:44 +0000 Subject: [PATCH] Add scrolling with page_up and page_down --- deluge/ui/console/screen.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deluge/ui/console/screen.py b/deluge/ui/console/screen.py index 67faa4e7f..7eec62dce 100644 --- a/deluge/ui/console/screen.py +++ b/deluge/ui/console/screen.py @@ -324,6 +324,19 @@ class Screen(CursesStdIO): elif c == curses.KEY_END: self.input_cursor = len(self.input) + # Scrolling through buffer + elif c == curses.KEY_PPAGE: + self.display_lines_offset += self.rows - 3 + if self.display_lines_offset > (len(self.lines) - 1 - self.rows - 3): + self.display_lines_offset = len(self.lines) - 1 - self.rows - 3 + + self.refresh() + elif c == curses.KEY_NPAGE: + self.display_lines_offset -= self.rows - 3 + if self.display_lines_offset < 0: + self.display_lines_offset = 0 + self.refresh() + # 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: