mirror of
https://github.com/OrbTools/OrbBind
synced 2024-10-31 03:20:26 +00:00
Make saving work, cleanup, an cki3 work
This commit is contained in:
parent
6bd9ee3165
commit
dd5d85ea08
10
go.mod
10
go.mod
@ -4,14 +4,16 @@ go 1.16
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
fyne.io/fyne/v2 v2.0.3
|
fyne.io/fyne/v2 v2.0.3
|
||||||
github.com/OrbTools/OrbCommon v0.0.0-20210512020311-0896f3a8de6f
|
github.com/OrbTools/OrbCommon v0.0.0-20210604213605-2c1ec68f6f91
|
||||||
|
github.com/fyne-io/mobile v0.1.3-0.20210524083716-78f416561547 // indirect
|
||||||
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0 // indirect
|
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/srwiley/oksvg v0.0.0-20210320200257-875f767ac39a // indirect
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe // indirect
|
||||||
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 // indirect
|
||||||
github.com/stretchr/testify v1.7.0 // indirect
|
github.com/stretchr/testify v1.7.0 // indirect
|
||||||
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e // indirect
|
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e // indirect
|
||||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
|
||||||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 // indirect
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
)
|
)
|
||||||
|
22
go.sum
22
go.sum
@ -1,8 +1,8 @@
|
|||||||
fyne.io/fyne/v2 v2.0.3 h1:qzd2uLLrAVrNeqnLY44QZCsMxZwjoo1my+lMzHicMXY=
|
fyne.io/fyne/v2 v2.0.3 h1:qzd2uLLrAVrNeqnLY44QZCsMxZwjoo1my+lMzHicMXY=
|
||||||
fyne.io/fyne/v2 v2.0.3/go.mod h1:nNpgL7sZkDVLraGtQII2ArNRnnl6kHup/KfQRxIhbvs=
|
fyne.io/fyne/v2 v2.0.3/go.mod h1:nNpgL7sZkDVLraGtQII2ArNRnnl6kHup/KfQRxIhbvs=
|
||||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
||||||
github.com/OrbTools/OrbCommon v0.0.0-20210512020311-0896f3a8de6f h1:26ndpRVB/Z+1tPGzYcRVwQ9m2V+d9K9o9y2ioNkJBdg=
|
github.com/OrbTools/OrbCommon v0.0.0-20210604213605-2c1ec68f6f91 h1:zsCP3Xou+cciiCjs/hTT5Ecr9WT1X0mIsfX4MR0nYW8=
|
||||||
github.com/OrbTools/OrbCommon v0.0.0-20210512020311-0896f3a8de6f/go.mod h1:8HEhD7wF9Fqritt/jYxDmjbxEScWhFfVajdYdPO5Y14=
|
github.com/OrbTools/OrbCommon v0.0.0-20210604213605-2c1ec68f6f91/go.mod h1:8HEhD7wF9Fqritt/jYxDmjbxEScWhFfVajdYdPO5Y14=
|
||||||
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
@ -12,8 +12,9 @@ github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8
|
|||||||
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
|
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
|
||||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a h1:3TAJhl8vXyli0tooKB0vd6gLCyBdWL4QEYbDoJpHEZk=
|
|
||||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||||
|
github.com/fyne-io/mobile v0.1.3-0.20210524083716-78f416561547 h1:q3mR3AT73LxwifSK+gNEQFweMiKLXt3p373X5xbIK+4=
|
||||||
|
github.com/fyne-io/mobile v0.1.3-0.20210524083716-78f416561547/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
||||||
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0 h1:7xNa69TzlTrKtlBtE4yyNRFP9oqAneXAs9oKJkVOECs=
|
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0 h1:7xNa69TzlTrKtlBtE4yyNRFP9oqAneXAs9oKJkVOECs=
|
||||||
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
|
github.com/go-gl/gl v0.0.0-20210501111010-69f74958bac0/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
|
||||||
@ -41,10 +42,11 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
|||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
||||||
github.com/srwiley/oksvg v0.0.0-20210320200257-875f767ac39a h1:Lhe6HPtH4ndWfV56fWc4/yQhOP3vEGlwl5nfPyBxUAg=
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe h1:J5Ga/gb+4/WgJBupg9Fp8F6JQnUT3UF+asoTweLi9Jc=
|
||||||
github.com/srwiley/oksvg v0.0.0-20210320200257-875f767ac39a/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
||||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM=
|
|
||||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
||||||
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 h1:oDMiXaTMyBEuZMU53atpxqYsSB3U1CHkeAu2zr6wTeY=
|
||||||
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
@ -62,8 +64,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
|
|||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
|
||||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -73,8 +75,8 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q=
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I=
|
||||||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
41
keys/keys.go
41
keys/keys.go
@ -10,39 +10,20 @@ import (
|
|||||||
|
|
||||||
func FyneToKeymap(e *fyne.KeyEvent) hid.Key {
|
func FyneToKeymap(e *fyne.KeyEvent) hid.Key {
|
||||||
switch e.Name {
|
switch e.Name {
|
||||||
case fyne.Key0:
|
case fyne.Key0, fyne.Key1, fyne.Key2, fyne.Key3, fyne.Key4, fyne.Key5, fyne.Key6, fyne.Key7, fyne.Key8, fyne.Key9:
|
||||||
case fyne.Key1:
|
|
||||||
case fyne.Key2:
|
|
||||||
case fyne.Key3:
|
|
||||||
case fyne.Key4:
|
|
||||||
case fyne.Key5:
|
|
||||||
case fyne.Key6:
|
|
||||||
case fyne.Key7:
|
|
||||||
case fyne.Key8:
|
|
||||||
case fyne.Key9:
|
|
||||||
return hid.GetMappingFromName("DIGIT" + string(e.Name))
|
return hid.GetMappingFromName("DIGIT" + string(e.Name))
|
||||||
case fyne.KeyF1:
|
case fyne.KeyF1, fyne.KeyF2, fyne.KeyF3, fyne.KeyF4, fyne.KeyF5, fyne.KeyF6, fyne.KeyF7, fyne.KeyF8, fyne.KeyF9, fyne.KeyF10, fyne.KeyF11, fyne.KeyF12:
|
||||||
case fyne.KeyF2:
|
|
||||||
case fyne.KeyF3:
|
|
||||||
case fyne.KeyF4:
|
|
||||||
case fyne.KeyF5:
|
|
||||||
case fyne.KeyF6:
|
|
||||||
case fyne.KeyF7:
|
|
||||||
case fyne.KeyF8:
|
|
||||||
case fyne.KeyF9:
|
|
||||||
case fyne.KeyF10:
|
|
||||||
case fyne.KeyF11:
|
|
||||||
case fyne.KeyF12:
|
|
||||||
return hid.GetMappingFromName(string(e.Name))
|
return hid.GetMappingFromName(string(e.Name))
|
||||||
case fyne.KeyLeft:
|
case fyne.KeyLeft, fyne.KeyRight, fyne.KeyUp, fyne.KeyDown:
|
||||||
case fyne.KeyRight:
|
|
||||||
case fyne.KeyUp:
|
|
||||||
case fyne.KeyDown:
|
|
||||||
return hid.GetMappingFromName("ARROW_" + strings.ToUpper(string(e.Name)))
|
return hid.GetMappingFromName("ARROW_" + strings.ToUpper(string(e.Name)))
|
||||||
case fyne.KeyBackspace:
|
case fyne.KeyBackspace, fyne.KeyBackslash, fyne.KeyEscape, fyne.KeySpace:
|
||||||
case fyne.KeyBackslash:
|
|
||||||
case fyne.KeyEscape:
|
|
||||||
return hid.GetMappingFromName(strings.ToUpper(string(e.Name)))
|
return hid.GetMappingFromName(strings.ToUpper(string(e.Name)))
|
||||||
|
case fyne.KeyMinus:
|
||||||
|
return hid.GetMappingFromName("MINUS")
|
||||||
|
case fyne.KeyEqual:
|
||||||
|
return hid.GetMappingFromName("EQUAL")
|
||||||
|
case fyne.KeySemicolon:
|
||||||
|
return hid.GetMappingFromName("SEMICOLON")
|
||||||
case fyne.KeyReturn:
|
case fyne.KeyReturn:
|
||||||
return hid.GetMappingFromName("ENTER")
|
return hid.GetMappingFromName("ENTER")
|
||||||
case desktop.KeyAltLeft:
|
case desktop.KeyAltLeft:
|
||||||
@ -62,7 +43,7 @@ func FyneToKeymap(e *fyne.KeyEvent) hid.Key {
|
|||||||
default:
|
default:
|
||||||
return hid.GetMappingFromName("US_" + strings.ToUpper(string(e.Name)))
|
return hid.GetMappingFromName("US_" + strings.ToUpper(string(e.Name)))
|
||||||
}
|
}
|
||||||
return hid.GetMappingFromName("USB_RESERVED")
|
//return hid.GetMappingFromName("USB_RESERVED")
|
||||||
}
|
}
|
||||||
|
|
||||||
func KeyFromEvdev(b uint16) hid.Key {
|
func KeyFromEvdev(b uint16) hid.Key {
|
||||||
|
@ -19,7 +19,7 @@ func main() {
|
|||||||
//pages := make(map[string]baseui.PageWithBindings)
|
//pages := make(map[string]baseui.PageWithBindings)
|
||||||
//pages["main"] = mainpage.NewMainPage(window, omap)
|
//pages["main"] = mainpage.NewMainPage(window, omap)
|
||||||
//pages["side"] = sidepage.NewSidePage(window, omap)
|
//pages["side"] = sidepage.NewSidePage(window, omap)
|
||||||
tabs, setter := mui.Generate(orbweaver.GUI, window, reflect.ValueOf(omap))
|
tabs, setter, getter := mui.Generate(orbweaver.GUI, window, reflect.ValueOf(omap))
|
||||||
//tabs := widget.NewTabContainer(pages["main"].Create(), pages["side"].Create())
|
//tabs := widget.NewTabContainer(pages["main"].Create(), pages["side"].Create())
|
||||||
tabs.Resize(fyne.NewSize(640, 480))
|
tabs.Resize(fyne.NewSize(640, 480))
|
||||||
main := tabs
|
main := tabs
|
||||||
@ -31,7 +31,7 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if writer != nil {
|
if writer != nil {
|
||||||
orbweaver.SavePKMKeymap(omap, writer)
|
orbweaver.SavePKMKeymap(getter().Interface(), writer)
|
||||||
}
|
}
|
||||||
}, window)
|
}, window)
|
||||||
}), fyne.NewMenuItem("Load", func() {
|
}), fyne.NewMenuItem("Load", func() {
|
||||||
@ -43,8 +43,6 @@ func main() {
|
|||||||
if reader != nil {
|
if reader != nil {
|
||||||
omap := orbweaver.LoadPKMKeymap(reader)
|
omap := orbweaver.LoadPKMKeymap(reader)
|
||||||
setter(reflect.ValueOf(omap))
|
setter(reflect.ValueOf(omap))
|
||||||
// pages["main"].SetBindings(omap)
|
|
||||||
// pages["side"].SetBindings(omap)
|
|
||||||
}
|
}
|
||||||
}, window)
|
}, window)
|
||||||
})))
|
})))
|
||||||
|
@ -34,6 +34,9 @@ func (bp *Page) createGrid() *fyne.Container {
|
|||||||
bp.Bind.Bound = 0x0
|
bp.Bind.Bound = 0x0
|
||||||
bp.dev["BL"].(*widget.Label).SetText(keys.KeyFromEvdev(bp.Bind.Bound).Code)
|
bp.dev["BL"].(*widget.Label).SetText(keys.KeyFromEvdev(bp.Bind.Bound).Code)
|
||||||
}))
|
}))
|
||||||
|
cont.Add(widget.NewButton("TAB", func() {
|
||||||
|
bp.TypeKey(&fyne.KeyEvent{Name: fyne.KeyTab})
|
||||||
|
}))
|
||||||
return cont
|
return cont
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//Generate creates a GUI from definition
|
//Generate creates a GUI from definition
|
||||||
func Generate(ui *gui.GUI, window fyne.Window, KBS reflect.Value) (*container.AppTabs, func(reflect.Value)) {
|
func Generate(ui *gui.GUI, window fyne.Window, KBS reflect.Value) (*container.AppTabs, func(reflect.Value), func() reflect.Value) {
|
||||||
keybind := KBS
|
keybind := KBS
|
||||||
tui := container.NewAppTabs()
|
tui := container.NewAppTabs()
|
||||||
for _, page := range ui.Pages[:] {
|
for _, page := range ui.Pages[:] {
|
||||||
@ -51,5 +51,5 @@ func Generate(ui *gui.GUI, window fyne.Window, KBS reflect.Value) (*container.Ap
|
|||||||
ti := container.NewTabItem(page.Name, cont)
|
ti := container.NewTabItem(page.Name, cont)
|
||||||
tui.Append(ti)
|
tui.Append(ti)
|
||||||
}
|
}
|
||||||
return tui, func(v reflect.Value) { keybind = v }
|
return tui, func(v reflect.Value) { keybind = v }, func() reflect.Value { return keybind }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user