mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 01:48:40 +00:00
make the delete key work in the console ui
This commit is contained in:
parent
fc3ae8229f
commit
e884d2cbfa
2 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
==== Console ====
|
==== Console ====
|
||||||
* Escape hyphens in the manpage
|
* Escape hyphens in the manpage
|
||||||
|
* Make the delete key work
|
||||||
|
|
||||||
=== Deluge 1.2.0_rc3 (01 November 2009) ===
|
=== Deluge 1.2.0_rc3 (01 November 2009) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -381,12 +381,18 @@ class Screen(CursesStdIO):
|
||||||
self.display_lines_offset = 0
|
self.display_lines_offset = 0
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
|
open("/tmp/key_logger", "a").write(str(c) + "\n")
|
||||||
|
|
||||||
# Delete a character in the input string based on cursor position
|
# Delete a character in the input string based on cursor position
|
||||||
if c == curses.KEY_BACKSPACE or c == 127:
|
if c == curses.KEY_BACKSPACE or c == 127:
|
||||||
if self.input and self.input_cursor > 0:
|
if self.input and self.input_cursor > 0:
|
||||||
self.input = self.input[:self.input_cursor - 1] + self.input[self.input_cursor:]
|
self.input = self.input[:self.input_cursor - 1] + self.input[self.input_cursor:]
|
||||||
self.input_cursor -= 1
|
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
|
# A key to add to the input string
|
||||||
else:
|
else:
|
||||||
if c > 31 and c < 127:
|
if c > 31 and c < 127:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue