{"action":"created","issue":{"url":"https://api.github.com/repos/jroimartin/gocui/issues/55","repository_url":"https://api.github.com/repos/jroimartin/gocui","labels_url":"https://api.github.com/repos/jroimartin/gocui/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/jroimartin/gocui/issues/55/comments","events_url":"https://api.github.com/repos/jroimartin/gocui/issues/55/events","html_url":"https://github.com/jroimartin/gocui/issues/55","id":171708669,"number":55,"title":"Keybinding on gocui.KeyEsc does not seem to work","user":{"login":"ERnsTL","id":3127919,"avatar_url":"https://avatars.githubusercontent.com/u/3127919?v=3","gravatar_id":"","url":"https://api.github.com/users/ERnsTL","html_url":"https://github.com/ERnsTL","followers_url":"https://api.github.com/users/ERnsTL/followers","following_url":"https://api.github.com/users/ERnsTL/following{/other_user}","gists_url":"https://api.github.com/users/ERnsTL/gists{/gist_id}","starred_url":"https://api.github.com/users/ERnsTL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ERnsTL/subscriptions","organizations_url":"https://api.github.com/users/ERnsTL/orgs","repos_url":"https://api.github.com/users/ERnsTL/repos","events_url":"https://api.github.com/users/ERnsTL/events{/privacy}","received_events_url":"https://api.github.com/users/ERnsTL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jroimartin/gocui/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/jroimartin/gocui/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"jroimartin","id":1223476,"avatar_url":"https://avatars.githubusercontent.com/u/1223476?v=3","gravatar_id":"","url":"https://api.github.com/users/jroimartin","html_url":"https://github.com/jroimartin","followers_url":"https://api.github.com/users/jroimartin/followers","following_url":"https://api.github.com/users/jroimartin/following{/other_user}","gists_url":"https://api.github.com/users/jroimartin/gists{/gist_id}","starred_url":"https://api.github.com/users/jroimartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroimartin/subscriptions","organizations_url":"https://api.github.com/users/jroimartin/orgs","repos_url":"https://api.github.com/users/jroimartin/repos","events_url":"https://api.github.com/users/jroimartin/events{/privacy}","received_events_url":"https://api.github.com/users/jroimartin/received_events","type":"User","site_admin":false},"assignees":[{"login":"jroimartin","id":1223476,"avatar_url":"https://avatars.githubusercontent.com/u/1223476?v=3","gravatar_id":"","url":"https://api.github.com/users/jroimartin","html_url":"https://github.com/jroimartin","followers_url":"https://api.github.com/users/jroimartin/followers","following_url":"https://api.github.com/users/jroimartin/following{/other_user}","gists_url":"https://api.github.com/users/jroimartin/gists{/gist_id}","starred_url":"https://api.github.com/users/jroimartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroimartin/subscriptions","organizations_url":"https://api.github.com/users/jroimartin/orgs","repos_url":"https://api.github.com/users/jroimartin/repos","events_url":"https://api.github.com/users/jroimartin/events{/privacy}","received_events_url":"https://api.github.com/users/jroimartin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-08-17T16:58:52Z","updated_at":"2016-08-31T13:02:59Z","closed_at":null,"body":"Greetings, I just wanted to catch the Escape key via a key binding, but it did not work. I used other key bindings, so they generally seem to work. I tried in different terminal emulators, checked escape sequence options. System here: recent Ubuntu Linux.\r\n\r\nCopy-paste test program:\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"log\"\r\n\r\n\t\"github.com/jroimartin/gocui\"\r\n)\r\n\r\nfunc main() {\r\n\tg := gocui.NewGui()\r\n\tif err := g.Init(); err != nil {\r\n\t\tlog.Panicln(err)\r\n\t}\r\n\tdefer g.Close()\r\n\r\n\tg.SetLayout(layout)\r\n\tif err := g.SetKeybinding(\"\", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {\r\n\t\tlog.Panicln(err)\r\n\t}\r\n\tif err := g.SetKeybinding(\"main\", gocui.KeyEnter, gocui.ModNone, enterKey); err != nil {\r\n\t\tlog.Panicln(err)\r\n\t}\r\n\tif err := g.SetKeybinding(\"main\", gocui.KeyEsc, gocui.ModNone, escKey); err != nil {\r\n\t\tlog.Panicln(err)\r\n\t}\r\n\r\n\tif err := g.MainLoop(); err != nil && err != gocui.ErrQuit {\r\n\t\tlog.Panicln(err)\r\n\t}\r\n}\r\n\r\nfunc layout(g *gocui.Gui) error {\r\n\tif v, err := g.SetView(\"main\", 0, 0, 50, 10); err != nil {\r\n\t\tif err != gocui.ErrUnknownView {\r\n\t\t\treturn err\r\n\t\t}\r\n\t\tv.Frame = true\r\n\t\tv.Editable = true\r\n\t\tif err := g.SetCurrentView(\"main\"); err != nil {\r\n\t\t\treturn err\r\n\t\t}\r\n\t}\r\n\treturn nil\r\n}\r\n\r\nfunc quit(g *gocui.Gui, v *gocui.View) error {\r\n\treturn gocui.ErrQuit\r\n}\r\n\r\nfunc escKey(g *gocui.Gui, v *gocui.View) error {\r\n\tfmt.Fprint(v, \"ESC KEY\")\r\n\treturn nil\r\n}\r\n\r\nfunc enterKey(g *gocui.Gui, v *gocui.View) error {\r\n\tfmt.Fprint(v, \"ENTER KEY\")\r\n\treturn nil\r\n}\r\n```\r\n\r\nMaybe this is just a wrong keycode taken over from ```termbox```, I dont know."},"comment":{"url":"https://api.github.com/repos/jroimartin/gocui/issues/comments/243756624","html_url":"https://github.com/jroimartin/gocui/issues/55#issuecomment-243756624","issue_url":"https://api.github.com/repos/jroimartin/gocui/issues/55","id":243756624,"user":{"login":"jameycribbs","id":8166,"avatar_url":"https://avatars.githubusercontent.com/u/8166?v=3","gravatar_id":"","url":"https://api.github.com/users/jameycribbs","html_url":"https://github.com/jameycribbs","followers_url":"https://api.github.com/users/jameycribbs/followers","following_url":"https://api.github.com/users/jameycribbs/following{/other_user}","gists_url":"https://api.github.com/users/jameycribbs/gists{/gist_id}","starred_url":"https://api.github.com/users/jameycribbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jameycribbs/subscriptions","organizations_url":"https://api.github.com/users/jameycribbs/orgs","repos_url":"https://api.github.com/users/jameycribbs/repos","events_url":"https://api.github.com/users/jameycribbs/events{/privacy}","received_events_url":"https://api.github.com/users/jameycribbs/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T13:02:59Z","updated_at":"2016-08-31T13:02:59Z","body":"Excellent!  Thanks so much for this!  This gets cribbnotes_cui that much closer to feel like it has a real vim mode!"}}
{"actor":{"display_login":"jameycribbs"}}