{"action":"opened","issue":{"url":"https://api.github.com/repos/kotcrab/vis-ui/issues/301","repository_url":"https://api.github.com/repos/kotcrab/vis-ui","labels_url":"https://api.github.com/repos/kotcrab/vis-ui/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/kotcrab/vis-ui/issues/301/comments","events_url":"https://api.github.com/repos/kotcrab/vis-ui/issues/301/events","html_url":"https://github.com/kotcrab/vis-ui/issues/301","id":395926983,"node_id":"MDU6SXNzdWUzOTU5MjY5ODM=","number":301,"title":"No way to disable embedded Keyboard-Controls for PopupMenu ","user":{"login":"pFreak","id":2004063,"node_id":"MDQ6VXNlcjIwMDQwNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2004063?v=4","gravatar_id":"","url":"https://api.github.com/users/pFreak","html_url":"https://github.com/pFreak","followers_url":"https://api.github.com/users/pFreak/followers","following_url":"https://api.github.com/users/pFreak/following{/other_user}","gists_url":"https://api.github.com/users/pFreak/gists{/gist_id}","starred_url":"https://api.github.com/users/pFreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pFreak/subscriptions","organizations_url":"https://api.github.com/users/pFreak/orgs","repos_url":"https://api.github.com/users/pFreak/repos","events_url":"https://api.github.com/users/pFreak/events{/privacy}","received_events_url":"https://api.github.com/users/pFreak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-04T13:33:22Z","updated_at":"2019-01-04T13:33:22Z","closed_at":null,"author_association":"NONE","body":"Hi, first up: thanks for creating this library, it's helping me out a ton! :)\r\nI'm using the PopupMenu in my game and have a few problems with it.\r\nI implemented my own Keyboard-Handling and the Popup-Menu is interfering with it.\r\nThe StageListener that get's created during the construction of the object also listens to keyDown-Events and handles UP and DOWN-Presses to skip to the next item.\r\nI would like to disable this functionality, but everything that I would need to overwrite is private:\r\n- private void createListeners()\r\n- private InputListener stageListener\r\n\r\nI will use reflections for now, but it would be nice to have an option to disable this out of the box.\r\nIf you agree I could create a pull-request to simply make the createListeners-Method public or create a constructor with a boolean \"enableKeyboardSupport\" in the constructor which is true by default. \r\n\r\nAnother thing I noticed is that the \"void selectNextItem()\"-Method of the PopupMenu runs in an infinite-loop, when you have 2 actors added to the popup that are NOT MenuItems.\r\n\tprivate void selectNextItem () {\r\n\t\tSnapshotArray<Actor> children = getChildren();\r\n\t\tif (children.size == 0) return;\r\n\t\tint startIndex = activeItem == null ? 0 : children.indexOf(activeItem, true) + 1;\r\n\t\tfor (int i = startIndex; ; i++) {\r\n\t\t\tif (i >= children.size) i = 0;\r\n\t\t\tActor actor = children.get(i);\r\n\t\t\tif (actor instanceof MenuItem && ((MenuItem) actor).isDisabled() == false) {\r\n\t\t\t\tsetActiveItem((MenuItem) actor, true);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\nIt will search for a MenuItem and never find one, so the Game freezes.\r\n\r\nThanks :)"}}
{"actor":{"display_login":"pFreak"}}