summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-02-15 20:49:54 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-02-15 20:49:54 +0100
commitadf5a977a970fff1e3b42655ade0c3f61c3a8958 (patch)
treebeabfa8fcac607da10c4b2470033bdee8f8d008e /src
parentb707696b466087f59243a8fc5de18cc71761221a (diff)
downloadpoezio-adf5a977a970fff1e3b42655ade0c3f61c3a8958.tar.gz
poezio-adf5a977a970fff1e3b42655ade0c3f61c3a8958.tar.bz2
poezio-adf5a977a970fff1e3b42655ade0c3f61c3a8958.tar.xz
poezio-adf5a977a970fff1e3b42655ade0c3f61c3a8958.zip
Remove ^J from the shortcuts triggering the Enter event, because
we’ll use it to add a (real) \n into the input’s text. Also remove "\n" because it’s useless
Diffstat (limited to 'src')
-rw-r--r--src/data_forms.py4
-rw-r--r--src/tabs.py8
-rw-r--r--src/windows.py2
3 files changed, 3 insertions, 11 deletions
diff --git a/src/data_forms.py b/src/data_forms.py
index 0d215c1d..3b756304 100644
--- a/src/data_forms.py
+++ b/src/data_forms.py
@@ -196,14 +196,14 @@ class TextMultiWin(FieldInput, windows.Win):
elif key == 'KEY_RIGHT':
if self.val_pos < len(self.options)-1:
self.val_pos += 1
- elif key in ('^J', '^M', '\n'):
+ elif key == '^M':
self.edition_input = windows.Input()
self.edition_input.color = self.color
self.edition_input.resize(self.height, self.width, self.y, self.x)
self.edition_input.text = self.options[self.val_pos]
self.edition_input.key_end()
else:
- if key in ('^J', '^M', '\n'):
+ if key == '^M':
self.options[self.val_pos] = self.edition_input.get_text()
if not self.options[self.val_pos] and self.val_pos != len(self.options) -1:
del self.options[self.val_pos]
diff --git a/src/tabs.py b/src/tabs.py
index 9beb4499..209649ac 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -219,16 +219,14 @@ class ChatTab(Tab):
"""
A tab containing a chat of any type.
Just use this class instead of Tab if the tab needs a recent-words completion
- Also, \n, ^J and ^M are already bound to on_enter
+ Also, ^M is already bound to on_enter
And also, add the /say command
"""
def __init__(self, core, room):
Tab.__init__(self, core)
self._room = room
self.key_func['M-/'] = self.last_words_completion
- self.key_func['^J'] = self.on_enter
self.key_func['^M'] = self.on_enter
- self.key_func['\n'] = self.on_enter
self.commands['say'] = (self.command_say,
_("""Usage: /say <message>\nSay: Just send the message.
Useful if you want your message to begin with a '/'"""), None)
@@ -282,9 +280,7 @@ class InfoTab(ChatTab):
self.input = windows.Input()
self.name = "Info"
self.color_state = theme.COLOR_TAB_NORMAL
- self.key_func['^J'] = self.on_enter
self.key_func['^M'] = self.on_enter
- self.key_func['\n'] = self.on_enter
self.key_func['^I'] = self.completion
self.key_func['M-i'] = self.completion
self.resize()
@@ -804,7 +800,6 @@ class RosterInfoTab(Tab):
self.set_color_state(theme.COLOR_TAB_NORMAL)
self.key_func['^I'] = self.completion
self.key_func['M-i'] = self.completion
- self.key_func["^J"] = self.on_enter
self.key_func["^M"] = self.on_enter
self.key_func[' '] = self.on_space
self.key_func["/"] = self.on_slash
@@ -1217,7 +1212,6 @@ class MucListTab(Tab):
self.key_func["/"] = self.on_slash
self.key_func['j'] = self.join_selected
self.key_func['J'] = self.join_selected_no_focus
- self.key_func['^J'] = self.join_selected
self.key_func['^M'] = self.join_selected
self.commands['close'] = (self.close, _("Usage: /close\nClose: Just close this tab"), None)
self.resize()
diff --git a/src/windows.py b/src/windows.py
index 1a59f260..45a6d22b 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1118,9 +1118,7 @@ class CommandInput(Input):
self.on_success = on_success
self.on_input = on_input
self.help_message = help_message
- self.key_func['^J'] = self.success
self.key_func['^M'] = self.success
- self.key_func['\n'] = self.success
self.key_func['^G'] = self.abort
self.key_func['^C'] = self.abort