diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-08-07 23:20:21 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-08-07 23:20:21 +0200 |
commit | 3ef9228211df46ada9bb5b851682a9c7d833de56 (patch) | |
tree | 3bf40a1f43c97577f5cf317c937f55023c0bb186 /src/windows/inputs.py | |
parent | 0e2bba640e1ffcfaa7ce4bc6782f24b0f10b8c08 (diff) | |
download | poezio-3ef9228211df46ada9bb5b851682a9c7d833de56.tar.gz poezio-3ef9228211df46ada9bb5b851682a9c7d833de56.tar.bz2 poezio-3ef9228211df46ada9bb5b851682a9c7d833de56.tar.xz poezio-3ef9228211df46ada9bb5b851682a9c7d833de56.zip |
Continuation keys (like after M-j or Ctrl-c) are handled without blocking
Diffstat (limited to 'src/windows/inputs.py')
-rw-r--r-- | src/windows/inputs.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/windows/inputs.py b/src/windows/inputs.py index ff13a562..afce3dd8 100644 --- a/src/windows/inputs.py +++ b/src/windows/inputs.py @@ -8,6 +8,7 @@ log = logging.getLogger(__name__) import curses import string +import keyboard import common import poopt from . import Win @@ -655,11 +656,12 @@ class MessageInput(HistoryInput): """ Read one more char (c), add the corresponding char from formats_char to the text string """ - attr_char = self.core.read_keyboard()[0] - if attr_char in self.text_attributes: - char = format_chars[self.text_attributes.index(attr_char)] - self.do_command(char, False) - self.rewrite_text() + def cb(attr_char): + if attr_char in self.text_attributes: + char = format_chars[self.text_attributes.index(attr_char)] + self.do_command(char, False) + self.rewrite_text() + keyboard.continuation_keys_callback = cb def key_enter(self): if self.history_enter(): |