We give Shortcut Key to the lower case to reduce confusion. (#32)

This commit is contained in:
Kuprijanov Roman
2021-12-02 20:36:00 +02:00
committed by GitHub
parent 923f11be3e
commit 21defdafdc
5 changed files with 11 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"unicode"
"github.com/asdine/storm/v3"
"github.com/gdamore/tcell/v2"
@@ -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

View File

@@ -1,6 +1,8 @@
package main
import (
"unicode"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
@@ -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

View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"strings"
"unicode"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
@@ -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

View File

@@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"time"
"unicode"
"github.com/atotto/clipboard"
"github.com/gdamore/tcell/v2"
@@ -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

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"sort"
"time"
"unicode"
"github.com/asdine/storm/v3"
"github.com/gdamore/tcell/v2"
@@ -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