Browse Source

Add w/s as navigation

master
ivan 8 months ago
parent
commit
032b4b1ab0
  1. 14
      sshch/sshch

14
sshch/sshch

@ -20,7 +20,7 @@ import curses
from curses import textpad, panel
# https://gitlab.com/zlax/sshch
version = "1.08"
version = "1.09"
# expand groups by default
expand_default = True
# path to conf dir and file, default: ~/.config/sshch.conf
@ -491,7 +491,7 @@ def CMDOptions():
def CursesMain():
help_screen = ("".join([" Press:\n",
" 'z'/'x' or arrows - navigation\n",
" 'z'/'x', 'w'/'s' or arrows - navigation\n",
" 'a'/'F2' - add new alias (without spaces)\n",
" 'g'/'F5' - add new group (spaces will be stripped)\n",
" 'e'/'F4' - edit existing alias/group\n",
@ -792,7 +792,8 @@ def CursesMain():
page = page + 1
position = 1 + (max_row * (page - 1))
if key_pressed == curses.KEY_DOWN or key_pressed == ord(
'x') or key_pressed == ord('X'):
'x') or key_pressed == ord('X') or key_pressed == ord(
's') or key_pressed == ord('S'):
if page == 1:
if position < i:
position = position + 1
@ -810,7 +811,8 @@ def CursesMain():
page = page + 1
position = 1 + (max_row * (page - 1))
if key_pressed == curses.KEY_UP or key_pressed == ord(
'z') or key_pressed == ord('Z'):
'z') or key_pressed == ord('Z') or key_pressed == ord(
'w') or key_pressed == ord('W'):
if page == 1:
if position > 1:
position = position - 1
@ -821,12 +823,12 @@ def CursesMain():
page = page - 1
position = max_row + (max_row * (page - 1))
if key_pressed == curses.KEY_LEFT or (key_pressed ==
curses.KEY_PPAGE):
curses.KEY_PPAGE):
if page > 1:
page = page - 1
position = 1 + (max_row * (page - 1))
if key_pressed == curses.KEY_RIGHT or (key_pressed ==
curses.KEY_NPAGE):
curses.KEY_NPAGE):
if page < pages:
page = page + 1
position = (1 + (max_row * (page - 1)))

Loading…
Cancel
Save