Skip to content

Commit

Permalink
We give Shortcut Key to the lower case to reduce confusion. (ajaxray#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
saaremaa committed Dec 2, 2021
1 parent 923f11b commit 21defda
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"unicode"

"github.com/asdine/storm/v3"
"github.com/gdamore/tcell/v2"
Expand Down Expand Up @@ -84,7 +85,7 @@ func setKeyboardShortcuts() *tview.Application {
}

// Global shortcuts
switch event.Rune() {
switch unicode.ToLower(event.Rune()) {
case 'p':
app.SetFocus(projectPane)
return nil
Expand Down
4 changes: 3 additions & 1 deletion app/project_detail.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"unicode"

"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"

Expand Down Expand Up @@ -44,7 +46,7 @@ func (pd *ProjectDetailPane) isShowing() bool {
}

func (pd *ProjectDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
switch event.Rune() {
switch unicode.ToLower(event.Rune()) {
case 'd':
projectPane.RemoveActivateProject()
return nil
Expand Down
3 changes: 2 additions & 1 deletion app/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"strings"
"unicode"

"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
Expand Down Expand Up @@ -111,7 +112,7 @@ func (pane *ProjectPane) addSection(name string) {
}

func (pane *ProjectPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
switch event.Rune() {
switch unicode.ToLower(event.Rune()) {
case 'j':
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
return nil
Expand Down
3 changes: 2 additions & 1 deletion app/task_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"time"
"unicode"

"github.com/atotto/clipboard"
"github.com/gdamore/tcell/v2"
Expand Down Expand Up @@ -297,7 +298,7 @@ func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey
td.taskDetailView.ScrollUp(1)
return nil
case tcell.KeyRune:
switch event.Rune() {
switch unicode.ToLower(event.Rune()) {
case 'e':
td.activateEditor()
return nil
Expand Down
3 changes: 2 additions & 1 deletion app/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"sort"
"time"
"unicode"

"github.com/asdine/storm/v3"
"github.com/gdamore/tcell/v2"
Expand Down Expand Up @@ -102,7 +103,7 @@ func (pane *TaskPane) addTaskToList(i int) *tview.List {
}

func (pane *TaskPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
switch event.Rune() {
switch unicode.ToLower(event.Rune()) {
case 'j':
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
return nil
Expand Down

0 comments on commit 21defda

Please sign in to comment.