add curses texpad del, home, end handlers
This commit is contained in:
parent
cd501bdc1e
commit
2c5c87f555
2
setup.py
2
setup.py
|
@ -13,7 +13,7 @@ def main():
|
|||
long_description='SSH connection and aliases manager with curses and command line interface',
|
||||
long_description_content_type='text/x-rst',
|
||||
license='DWTWL 2.55',
|
||||
version='1.09.5',
|
||||
version='1.09.6',
|
||||
py_modules=['sshch'],
|
||||
scripts=['sshch/sshch'],
|
||||
keywords='sshch ssh aliases curses manager',
|
||||
|
|
12
sshch/sshch
12
sshch/sshch
|
@ -22,7 +22,7 @@ from curses import textpad, panel
|
|||
from threading import Thread
|
||||
|
||||
# https://gitlab.com/zlax/sshch
|
||||
version = "1.09.5"
|
||||
version = "1.09.6"
|
||||
# expand groups by default
|
||||
expand_default = True
|
||||
# path to conf dir and file, default: ~/.config/sshch.conf
|
||||
|
@ -360,10 +360,16 @@ class CursesTextpadEsc(Exception):
|
|||
|
||||
|
||||
def CursesTextpadConfirm(value):
|
||||
if value == 10:
|
||||
if value == 10: # Enter
|
||||
value = 7
|
||||
if value == 27:
|
||||
elif value == 27: # Esc
|
||||
raise CursesTextpadEsc()
|
||||
elif value == curses.KEY_DC: # Del
|
||||
value = curses.ascii.EOT
|
||||
elif value == curses.KEY_HOME: # Home
|
||||
value = curses.ascii.SOH
|
||||
elif value == curses.KEY_END: # End
|
||||
value = curses.ascii.ENQ
|
||||
return value
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue