summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-12-14 04:14:55 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-12-14 04:21:17 +0100
commit0ef9d3594beb8c0bd95dcf8dbb55fa2dda1f2777 (patch)
tree3415983227f9914b7a6916e28cb421e895e1f2a8 /src/core.py
parent1835d3649504389b773452bbb0bcf7469f53fdd9 (diff)
downloadpoezio-0ef9d3594beb8c0bd95dcf8dbb55fa2dda1f2777.tar.gz
poezio-0ef9d3594beb8c0bd95dcf8dbb55fa2dda1f2777.tar.bz2
poezio-0ef9d3594beb8c0bd95dcf8dbb55fa2dda1f2777.tar.xz
poezio-0ef9d3594beb8c0bd95dcf8dbb55fa2dda1f2777.zip
Use get_wch() if available, otherwise use the old (maybe buggy) method.
This makes it possible to read the ctrl+arrows keys with python3.3, assign ctrl+left/right to next/previous tab, in the default config.
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core.py b/src/core.py
index 4e17d747..5dc45063 100644
--- a/src/core.py
+++ b/src/core.py
@@ -52,7 +52,7 @@ from logger import logger
from roster import roster
from contact import Contact, Resource
from text_buffer import TextBuffer
-from keyboard import read_char
+from keyboard import keyboard
from theming import get_theme
from fifo import Fifo
from windows import g_lock
@@ -205,9 +205,11 @@ class Core(object):
"^S": self.scroll_half_up,
"KEY_F(5)": self.rotate_rooms_left,
"^P": self.rotate_rooms_left,
+ "M-[-D": self.rotate_rooms_left,
'kLFT3': self.rotate_rooms_left,
"KEY_F(6)": self.rotate_rooms_right,
"^N": self.rotate_rooms_right,
+ "M-[-C": self.rotate_rooms_right,
'kRIT3': self.rotate_rooms_right,
"KEY_F(4)": self.toggle_left_pane,
"KEY_F(7)": self.shrink_information_win,
@@ -1077,8 +1079,8 @@ class Core(object):
curses.noecho()
curses.nonl()
curses.raw()
- stdscr.idlok(True)
- stdscr.keypad(True)
+ stdscr.idlok(1)
+ stdscr.keypad(1)
curses.start_color()
curses.use_default_colors()
theming.reload_theme()
@@ -1298,14 +1300,14 @@ class Core(object):
def read_keyboard(self):
"""
Get the next keyboard key pressed and returns it.
- read_char() has a timeout: it returns None when the timeout
+ get_user_input() has a timeout: it returns None when the timeout
occurs. In that case we do not return (we loop until we get
a non-None value), but we check for timed events instead.
"""
- res = read_char(self.stdscr)
+ res = keyboard.get_user_input(self.stdscr)
while res is None:
self.check_timed_events()
- res = read_char(self.stdscr)
+ res = keyboard.get_user_input(self.stdscr)
return res
####################### Commands and completions ##############################