We give Shortcut Key to the lower case to reduce confusion. (#32)
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/asdine/storm/v3"
|
"github.com/asdine/storm/v3"
|
||||||
"github.com/gdamore/tcell/v2"
|
"github.com/gdamore/tcell/v2"
|
||||||
@@ -84,7 +85,7 @@ func setKeyboardShortcuts() *tview.Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Global shortcuts
|
// Global shortcuts
|
||||||
switch event.Rune() {
|
switch unicode.ToLower(event.Rune()) {
|
||||||
case 'p':
|
case 'p':
|
||||||
app.SetFocus(projectPane)
|
app.SetFocus(projectPane)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/gdamore/tcell/v2"
|
"github.com/gdamore/tcell/v2"
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ func (pd *ProjectDetailPane) isShowing() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pd *ProjectDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
|
func (pd *ProjectDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
|
||||||
switch event.Rune() {
|
switch unicode.ToLower(event.Rune()) {
|
||||||
case 'd':
|
case 'd':
|
||||||
projectPane.RemoveActivateProject()
|
projectPane.RemoveActivateProject()
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/gdamore/tcell/v2"
|
"github.com/gdamore/tcell/v2"
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
@@ -111,7 +112,7 @@ func (pane *ProjectPane) addSection(name string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pane *ProjectPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
|
func (pane *ProjectPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
|
||||||
switch event.Rune() {
|
switch unicode.ToLower(event.Rune()) {
|
||||||
case 'j':
|
case 'j':
|
||||||
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
|
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/atotto/clipboard"
|
"github.com/atotto/clipboard"
|
||||||
"github.com/gdamore/tcell/v2"
|
"github.com/gdamore/tcell/v2"
|
||||||
@@ -297,7 +298,7 @@ func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey
|
|||||||
td.taskDetailView.ScrollUp(1)
|
td.taskDetailView.ScrollUp(1)
|
||||||
return nil
|
return nil
|
||||||
case tcell.KeyRune:
|
case tcell.KeyRune:
|
||||||
switch event.Rune() {
|
switch unicode.ToLower(event.Rune()) {
|
||||||
case 'e':
|
case 'e':
|
||||||
td.activateEditor()
|
td.activateEditor()
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/asdine/storm/v3"
|
"github.com/asdine/storm/v3"
|
||||||
"github.com/gdamore/tcell/v2"
|
"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 {
|
func (pane *TaskPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
|
||||||
switch event.Rune() {
|
switch unicode.ToLower(event.Rune()) {
|
||||||
case 'j':
|
case 'j':
|
||||||
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
|
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user