File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ func InitKeymap(p KeymapPrimitive, app *App) {
22
22
// do not capture characters for InputField and TextArea
23
23
switch app .GetFocus ().(type ) {
24
24
case * tview.InputField , * tview.TextArea :
25
- return event
25
+ if ! IsControlKey (event ) {
26
+ return event
27
+ }
26
28
}
27
29
28
30
handler , ok := keymaps .FindHandler (util .AsKey (event ))
@@ -35,6 +37,18 @@ func InitKeymap(p KeymapPrimitive, app *App) {
35
37
})
36
38
}
37
39
40
+ // IsControlKey returns true if the key is a control key.
41
+ func IsControlKey (evt * tcell.EventKey ) bool {
42
+ if evt .Modifiers () & tcell .ModCtrl != 0 {
43
+ return true
44
+ }
45
+ switch evt .Key () {
46
+ case tcell .KeyEsc , tcell .KeyTab :
47
+ return true
48
+ }
49
+ return false
50
+ }
51
+
38
52
func Inc (i * int ) int {
39
53
t := * i
40
54
* i ++
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ func (t *TransactionDetail) KeyMaps() util.KeyMaps {
78
78
// KeyF: jump to sender's account page
79
79
keymaps = append (keymaps , util.KeyMap {
80
80
Key : util .KeyF ,
81
- Shortcut : "F " ,
81
+ Shortcut : "f " ,
82
82
Description : "View Sender" ,
83
83
Handler : func (* tcell.EventKey ) {
84
84
t .viewAccount (t .from .GetText ())
@@ -87,7 +87,7 @@ func (t *TransactionDetail) KeyMaps() util.KeyMaps {
87
87
// KeyT: jump to receiver's account page
88
88
keymaps = append (keymaps , util.KeyMap {
89
89
Key : util .KeyT ,
90
- Shortcut : "T " ,
90
+ Shortcut : "t " ,
91
91
Description : "View Receiver" ,
92
92
Handler : func (* tcell.EventKey ) {
93
93
t .viewAccount (t .to .GetText ())
You can’t perform that action at this time.
0 commit comments