Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add alternative keybindings for calendar gui #40

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions girok/calendar_cli/calendar_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,20 @@ def on_key(self, event):
if self.is_pop_up:
return
x, y = self.cur_focused_cell_cord
if event.key == 'h': # left
if event.key == 'h' or event.key == 'left': # left
next_cell_coord = (x, y - 1)
elif event.key == 'j': # down
elif event.key == 'j' or event.key == 'down': # down
next_cell_coord = (x + 1, y)
elif event.key == 'k': # up
elif event.key == 'k' or event.key == 'up': # up
next_cell_coord = (x - 1, y)
elif event.key == 'l': # right
elif event.key == 'l' or event.key == 'right': # right
next_cell_coord = (x, y + 1)
elif event.key == 'o':
pass
else:
return

if event.key in ['h', 'j', 'k', 'l']: # moving on cells
if event.key in ['h', 'j', 'k', 'l', 'left', 'down', 'up', 'right']: # moving on cells
nx, ny = next_cell_coord
if nx < 0 or ny < 0 or nx >= self.m or ny >= self.n: # Out of matrix
return
Expand Down
10 changes: 5 additions & 5 deletions girok/calendar_cli/calendar_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class Entry(App):
is_pop_up = False
BINDINGS = [
("q", "quit", "Quit Nuro"),
("u", "show_previous_month", "Show prev month"),
("i", "show_next_month", "Show next month"),
("y", "show_current_month", "Show current month"),
("e", "focus_on_calendar", "Move to calendar"),
("w", "focus_on_sidebar", "Move to sidebar"),
("u,ctrl+up", "show_previous_month", "Show prev month"),
("i,ctrl+down", "show_next_month", "Show next month"),
("y,ctrl+u", "show_current_month", "Show current month"),
("e,ctrl+right", "focus_on_calendar", "Move to calendar"),
("w,ctrl+left", "focus_on_sidebar", "Move to sidebar"),
("ctrl+j", "move_down_to_tag_tree", "Move down to tag tree"),
("ctrl+k", "move_up_to_category_tree", "Move up to category tree"),
("o", 'close_pop_up', "Close pop up box"),
Expand Down