add curses texpad del, home, end handlers

This commit is contained in:
ivan 2022-06-17 21:55:01 +03:00
parent cd501bdc1e
commit 2c5c87f555
2 changed files with 10 additions and 4 deletions

View File

@ -13,7 +13,7 @@ def main():
long_description='SSH connection and aliases manager with curses and command line interface', long_description='SSH connection and aliases manager with curses and command line interface',
long_description_content_type='text/x-rst', long_description_content_type='text/x-rst',
license='DWTWL 2.55', license='DWTWL 2.55',
version='1.09.5', version='1.09.6',
py_modules=['sshch'], py_modules=['sshch'],
scripts=['sshch/sshch'], scripts=['sshch/sshch'],
keywords='sshch ssh aliases curses manager', keywords='sshch ssh aliases curses manager',

View File

@ -22,7 +22,7 @@ from curses import textpad, panel
from threading import Thread from threading import Thread
# https://gitlab.com/zlax/sshch # https://gitlab.com/zlax/sshch
version = "1.09.5" version = "1.09.6"
# expand groups by default # expand groups by default
expand_default = True expand_default = True
# path to conf dir and file, default: ~/.config/sshch.conf # path to conf dir and file, default: ~/.config/sshch.conf
@ -360,10 +360,16 @@ class CursesTextpadEsc(Exception):
def CursesTextpadConfirm(value): def CursesTextpadConfirm(value):
if value == 10: if value == 10: # Enter
value = 7 value = 7
if value == 27: elif value == 27: # Esc
raise CursesTextpadEsc() 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 return value