Author: damoxc
Revision: 5914
Log:
make the delete key work in the console ui
Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog 2009-11-03 03:25:57 UTC (rev 5913)
+++ branches/1.2_RC/ChangeLog 2009-11-03 12:47:23 UTC (rev 5914)
@@ -9,6 +9,7 @@
==== Console ====
* Escape hyphens in the manpage
+ * Make the delete key work
=== Deluge 1.2.0_rc3 (01 November 2009) ===
==== Core ====
Modified: branches/1.2_RC/deluge/ui/console/screen.py
===================================================================
--- branches/1.2_RC/deluge/ui/console/screen.py 2009-11-03 03:25:57 UTC (rev
5913)
+++ branches/1.2_RC/deluge/ui/console/screen.py 2009-11-03 12:47:23 UTC (rev
5914)
@@ -381,12 +381,18 @@
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:
Modified: trunk/deluge/ui/console/screen.py
===================================================================
--- trunk/deluge/ui/console/screen.py 2009-11-03 03:25:57 UTC (rev 5913)
+++ trunk/deluge/ui/console/screen.py 2009-11-03 12:47:23 UTC (rev 5914)
@@ -381,12 +381,18 @@
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:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---