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

Shortcuts #467

Merged
merged 3 commits into from
Apr 19, 2024
Merged
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
4 changes: 4 additions & 0 deletions timetagger/app/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ def open(self, callback=None):
presets.children[0].innerHTML += " <span class='keyhint'>d</span>"
presets.children[1].innerHTML += " <span class='keyhint'>w</span>"
presets.children[2].innerHTML += " <span class='keyhint'>m</span>"
presets.children[3].innerHTML += " <span class='keyhint'>q</span>"
presets.children[4].innerHTML += " <span class='keyhint'>y</span>"

for i in range(presets.children.length):
but = presets.children[i]
Expand Down Expand Up @@ -3765,6 +3767,7 @@ def open(self, callback=None):
"D": "Select today",
"W": "Select this week",
"M": "Select this month",
"Q": "Select this quarter",
"Y": "Select this year",
"↑/PageUp": "Step back in time",
"↓/PageDown": "Step forward in time",
Expand All @@ -3774,6 +3777,7 @@ def open(self, callback=None):
"S": "Start the timer or add an earlier record",
"Shift+S": "Resume the current/previous record",
"X": "Stop the timer",
"F": "Open search dialog",
"T": "Select time range",
"R": "Open report dialog",
"I": "Open the guide",
Expand Down
9 changes: 9 additions & 0 deletions timetagger/app/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,10 @@ def on_pointer(self, ev):
def _on_key(self, e):
if e.ctrlKey or e.metaKey or e.altKey:
return # don't fight with the browser
#
elif e.key.lower() == "f":
self._handle_button_press("search")
#
elif e.key.lower() == "arrowup" or e.key.lower() == "pageup":
self._handle_button_press("nav_backward")
elif e.key.lower() == "arrowdown" or e.key.lower() == "pagedown":
Expand All @@ -1466,6 +1470,8 @@ def _on_key(self, e):
self._handle_button_press("nav_snap_now1W")
elif e.key.lower() == "m":
self._handle_button_press("nav_snap_now1M")
elif e.key.lower() == "q":
self._handle_button_press("nav_snap_now3M")
elif e.key.lower() == "y":
self._handle_button_press("nav_snap_now1Y")
elif e.key.lower() == "t":
Expand All @@ -1492,6 +1498,9 @@ def _handle_button_press(self, action):
if action == "menu":
self._canvas.menu_dialog.open()

elif action == "search":
self._canvas.search_dialog.open()

elif action == "login":
window.location.href = "../login"

Expand Down
Loading