{"action":"closed","issue":{"number":695,"created_at":"2011-10-11T11:03:50Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hello,\r\n\r\ni want write a Login Plugin with Spout, its my first Spout Project and should be a exercise.\r\nI want that the user can use the loginbutton + textfield for login, else he can press the Exit button for Disconnect.\r\nBut how i can lock the \"Esc\" Key? I try it with this :\r\n\r\nMain :\r\n\r\n```java\r\ngetServer().getPluginManager().registerEvent(Event.Type.CUSTOM_EVENT, new myInputListener(this), Event.Priority.Lowest, this); \r\n```\r\n(Highest or Normal don't work too)\r\n\r\nmyInputListener :\r\n\r\n```java\r\npublic void onKeyPressedEvent(KeyPressedEvent event) {\r\n\t\tif(plugin.menuOpen && event.getKey() == Keyboard.KEY_ESCAPE){\r\n\t\t\tevent.getPlayer().closeActiveWindow();\t\r\n\t\t\tevent.getPlayer().getMainScreen().closePopup();\r\n\t\t\t//event.getPlayer().getMainScreen().getActivePopup().close();\r\n\t\t\tdoGUI(event.getPlayer());\r\n\t\t}\r\n    }\r\n\t@SuppressWarnings(\"unused\")\r\n\tprivate void doGUI(SpoutPlayer pl){\r\n\t\tGenericPopup somepopup = new GenericPopup();\r\n\t\tGenericLabel label = new GenericLabel(\"This is a label\");\r\n\t\tsomepopup.attachWidget(label);\r\n\t\tpl.getMainScreen().attachWidget(label);\r\n\t\t\r\n\t\tGenericButton button = new GenericButton(\"Buttontext\");\r\n\t\tbutton.setX(100).setY(100); //Puts the button at 100*100 on the screen\r\n\t\tbutton.setWidth(200).setHeight(20); //Makes the button 200 wide and 20 high\r\n\t\tsomepopup.attachWidget(button); //This is necessary because you need a mouse to interact with a button.\r\n\t\tpl.getMainScreen().attachPopupScreen(somepopup);\t\t\r\n\t\tplugin.menuOpen = true;\t\t\r\n\t}\r\n```\r\n\r\nThen i press Esc it close the popup and nothing more. Then i press again esc its open the normal gamemenu, its quit and open my gui. Same try with onScreenClose() from ScreenListener, same result.","comments":2,"title":"How to Lock Escape a Popup with \"Esc\" Key","updated_at":"2011-10-11T15:28:29Z","url":"https://api.github.com/repos/SpoutDev/Spout/issues/695","id":1873677,"assignee":null,"milestone":null,"closed_at":"2011-10-11T15:28:29Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/ca0120a63160a159af717e7c4f8f854b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/TheCherry","id":1090782,"login":"TheCherry"},"html_url":"https://github.com/SpoutDev/Spout/issues/695","labels":[],"state":"closed"},"legacy":{"number":695,"action":"closed","issue":1873677}}