dirtywords

portable text interface framework  https://pypi.python.org/pypi/dirtywords
git clone https://git.ce9e.org/dirtywords.git

commit
276688c0ce58800ed741b9c0c8bfa020295d95cf
parent
cf434528d41c42d276125461d074b6c3a8d525e1
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-10-11 09:23
add some missing key codes to stupid_core

Diffstat

M dirtywords/stupid_core.py 10 ++++++++++

1 files changed, 10 insertions, 0 deletions


diff --git a/dirtywords/stupid_core.py b/dirtywords/stupid_core.py

@@ -61,6 +61,8 @@ class Screen(base.Screen):
   61    61                 l.append(self._getch())
   62    62                 while l[-1] not in range(64, 127):
   63    63                     l.append(self._getch())
   -1    64             elif l[1] == 79:
   -1    65                 l.append(self._getch())
   64    66             elif l[-1] in range(64, 96):
   65    67                 pass
   66    68             else:
@@ -85,8 +87,16 @@ class Screen(base.Screen):
   85    87             return KEYS['Delete']
   86    88         elif l == [27, 91, 50, 126]:
   87    89             return KEYS['Insert']
   -1    90         elif l == [127]:
   -1    91             return KEYS['Backspace']
   -1    92         elif l == [13]:
   -1    93             return KEYS['Return']
   88    94         elif len(l) == 1:
   89    95             return l[0]
   -1    96         elif l == [27, 79, 70]:
   -1    97             return KEYS['End']
   -1    98         elif l == [27, 79, 72]:
   -1    99             return KEYS['Home']
   90   100 
   91   101     def refresh(self):
   92   102         spacing = '\n' * self.height * 2