Commit 33ddc805 authored by Trevor Slocum's avatar Trevor Slocum
Browse files

Handle keypad enter key

parent e8346b53
Pipeline #168846133 passed with stages
in 14 minutes and 34 seconds
0.2.7:
- Handle keypad enter key
0.2.6:
- Handle cached icon loading errors
......
......@@ -146,7 +146,7 @@ func initTUI() (*cview.Application, error) {
entryList.selected = entryList.origin
return nil
} else if event.Key() == tcell.KeyEnter {
} else if event.Key() == tcell.KeyEnter || event.Rune() == '\n' {
runInTerminal := event.Modifiers()&tcell.ModAlt > 0
err := listSelect(runInTerminal)
......
......@@ -67,8 +67,8 @@ func handleKeybinding(_ *gtk.Window, ev *gdk.Event) bool {
}
return true
case gdk.KEY_Return:
runInTerminal := keyEvent.State()&uint(gdk.GDK_MOD1_MASK) > 0
case gdk.KEY_Return, gdk.KEY_KP_Enter, gdk.KEY_ISO_Enter, gdk.KEY_3270_Enter:
runInTerminal := keyEvent.State()&uint(gdk.MOD1_MASK) > 0
err := listSelect(inputView, runInTerminal)
if err != nil {
......
......@@ -304,7 +304,7 @@ func listSelect(_ *gtk.TextView, runInTerminal bool) error {
return nil
}
func listSort(row1 *gtk.ListBoxRow, row2 *gtk.ListBoxRow, _ uintptr) int {
func listSort(row1 *gtk.ListBoxRow, row2 *gtk.ListBoxRow, _ ...interface{}) int {
r1 := rowID(row1)
r2 := rowID(row2)
......@@ -329,7 +329,7 @@ func listSort(row1 *gtk.ListBoxRow, row2 *gtk.ListBoxRow, _ uintptr) int {
return 1
}
func listFilter(row *gtk.ListBoxRow, _ uintptr) bool {
func listFilter(row *gtk.ListBoxRow, _ ...interface{}) bool {
match := gmenu.MatchEntry(rowID(row))
row.SetSelectable(match)
......
......@@ -4,12 +4,12 @@ go 1.12
require (
github.com/gdamore/tcell v1.3.0
github.com/gotk3/gotk3 v0.0.0-20200122052051-1b4add5ab128
github.com/gotk3/gotk3 v0.4.1-0.20200709051429-524b15e69d0c
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/lithammer/fuzzysearch v1.1.0
github.com/mattn/go-isatty v0.0.12
github.com/mattn/go-runewidth v0.0.8 // indirect
gitlab.com/tslocum/cview v1.4.1
gitlab.com/tslocum/cview v1.4.7
gitlab.com/tslocum/desktop v0.1.4
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 // indirect
golang.org/x/text v0.3.3 // indirect
)
......@@ -4,8 +4,10 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdk
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM=
github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM=
github.com/gotk3/gotk3 v0.0.0-20200122052051-1b4add5ab128 h1:Hjk+U6RSAEZGx3VIhq9RSyVJlvCRp5AYyyc9VmxvjJ4=
github.com/gotk3/gotk3 v0.0.0-20200122052051-1b4add5ab128/go.mod h1:Eew3QBwAOBTrfFFDmsDE5wZWbcagBL1NUslj1GhRveo=
github.com/gotk3/gotk3 v0.4.0 h1:TIuhyQitGeRTxOQIV3AJlYtEWWJpC74JHwAIsxlH8MU=
github.com/gotk3/gotk3 v0.4.0/go.mod h1:Eew3QBwAOBTrfFFDmsDE5wZWbcagBL1NUslj1GhRveo=
github.com/gotk3/gotk3 v0.4.1-0.20200709051429-524b15e69d0c h1:3JQyV+xF0RIM3jUoOypJqhuZz34MTSiU6us/xjEDJQ0=
github.com/gotk3/gotk3 v0.4.1-0.20200709051429-524b15e69d0c/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/lithammer/fuzzysearch v1.1.0 h1:go9v8tLCrNTTlH42OAaq4eHFe81TDHEnlrMEb6R4f+A=
......@@ -18,24 +20,28 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
gitlab.com/tslocum/cview v1.4.1 h1:bG1ugSSFEe8B6poP+xEeo7OIP+Ph4JBOs1fAVtuvgjY=
gitlab.com/tslocum/cview v1.4.1/go.mod h1:QbxliYQa2I32UJH2boP54jq6tnWlgm6yViaFXKGDfuM=
gitlab.com/tslocum/cbind v0.1.1 h1:JXXtxMWHgWLvoF+QkrvcNvOQ59juy7OE1RhT7hZfdt0=
gitlab.com/tslocum/cbind v0.1.1/go.mod h1:rX7vkl0pUSg/yy427MmD1FZAf99S7WwpUlxF/qTpPqk=
gitlab.com/tslocum/cview v1.4.7 h1:8HkA2iwk9008FKDTbi6L0KkHoj2mFbgUW73DHw9iG1U=
gitlab.com/tslocum/cview v1.4.7/go.mod h1:87HOuFUfgmyY0zfg+7qKg6jyN9gI/znsa/KE2ZZHDSs=
gitlab.com/tslocum/desktop v0.1.4 h1:ew+nJFAaNLXQw9SlX3M2OZjHd55SJCc5k3J+rQUPA4E=
gitlab.com/tslocum/desktop v0.1.4/go.mod h1:xegVIo1fwhovdUkErI999g3qb5gK9T7+s76hMLDOXRg=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7 h1:/W9OPMnnpmFXHYkcp2rQsbFUbRlRzfECQjmAFiOyHE8=
golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 h1:gVCS+QOncANNPlmlO1AhlU3oxs4V9z+gTtPwIk3p2N8=
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
project_name: gmenu
before:
hooks:
- go mod download
builds:
-
id: gmenu
......@@ -20,6 +17,7 @@ builds:
goarch:
- 386
- amd64
- arm64
-
id: gtkmenu
binary: gtkmenu
......@@ -27,20 +25,28 @@ builds:
ldflags:
- -s -w -X gitlab.com/tslocum/gmenu/pkg/gmenu.Version={{.Version}}
goos:
# - darwin
# - freebsd
- linux
# - windows
goarch:
# - 386
- amd64
archive:
replacements:
386: i386
format_overrides:
- goos: windows
format: zip
files:
- ./*.md
- CHANGELOG
- LICENSE
# - arm64
archives:
-
id: gmenu
builds:
- gmenu
- gtkmenu
replacements:
386: i386
format_overrides:
- goos: windows
format: zip
files:
- ./*.md
- CHANGELOG
- LICENSE
checksum:
name_template: 'checksums.txt'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment