{"action":"created","issue":{"url":"https://api.github.com/repos/TestFX/TestFX/issues/591","repository_url":"https://api.github.com/repos/TestFX/TestFX","labels_url":"https://api.github.com/repos/TestFX/TestFX/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/TestFX/TestFX/issues/591/comments","events_url":"https://api.github.com/repos/TestFX/TestFX/issues/591/events","html_url":"https://github.com/TestFX/TestFX/pull/591","id":341727700,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNzk3NDQz","number":591,"title":"589 shortcut","user":{"login":"Ortner","id":1593763,"node_id":"MDQ6VXNlcjE1OTM3NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1593763?v=4","gravatar_id":"","url":"https://api.github.com/users/Ortner","html_url":"https://github.com/Ortner","followers_url":"https://api.github.com/users/Ortner/followers","following_url":"https://api.github.com/users/Ortner/following{/other_user}","gists_url":"https://api.github.com/users/Ortner/gists{/gist_id}","starred_url":"https://api.github.com/users/Ortner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ortner/subscriptions","organizations_url":"https://api.github.com/users/Ortner/orgs","repos_url":"https://api.github.com/users/Ortner/repos","events_url":"https://api.github.com/users/Ortner/events{/privacy}","received_events_url":"https://api.github.com/users/Ortner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-07-17T00:54:22Z","updated_at":"2018-07-18T09:53:37Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/TestFX/TestFX/pulls/591","html_url":"https://github.com/TestFX/TestFX/pull/591","diff_url":"https://github.com/TestFX/TestFX/pull/591.diff","patch_url":"https://github.com/TestFX/TestFX/pull/591.patch"},"body":"## Issue\r\nCommand-Key handling on mac. On my platform the tests in `ShortcutKeyTest.java` on master fail. I guess they are running on Travis somehow. There are pretty much issues relating to the mac `SHORTCUT` key (#589, #436, #590).\r\n\r\nPer specification, the `COMMAND`-Key on Mac does map to the `META` KeyCode in Java. The CONTROL key on Windows, well to the `CONTROL` KeyCode. Both Map to the `SHORTCUT` KeyCode in Java. The `SHORTCUT` is a generated Property by the JVM (a virtual, non existing key), it may not be used as real input. \r\n\r\n## Behaviour of KeyCodes on macOS\r\n\r\n- `press(KeyCode.META)` - Received by KeyEvent: `KeyCode.COMMAND`, `e.isShortShortcutDown()`: true\r\n- `press(KeyCode.SHORTCUT)` - Received by KeyEvent: `KeyCode.A`, `e.isShortShortcutDown()`: false (That's where all those 'a's in my text editor come from after running TestFX-Tests)\r\n- `press(KeyCode.CONTROL)` - Received by KeyEvent: `KeyCode.Ctrl`, `e.isShortShortcutDown()`: false\r\n- `press(KeyCode.COMMAND)` - Received by KeyEvent: nothing at all\r\n\r\n## Expected Behavior\r\n\r\n- `SHORTCUT+A`, `SHORTCUT+C`, `SHORTCUT+V` (...) should work\r\n- the method KeyEvent.isShortcutDown() should actually return true while pressed (currently it returns false)\r\n- KeyCode Combinations should work (e.g. robotContext().getTypeRobot().push(new KeyCodeCombination(KeyCode.O, KeyCombination.SHORTCUT_DOWN));) (#590, #589)\r\n\r\n## Solution\r\nSending `KeyCode.META` (macOS) and receiving `KeyCode.COMMAND`. Added test for the other points too.\r\n\r\n## Related issues\r\nfixes #589 #590  (forgot to close in commit message)\r\npartially #436 "},"comment":{"url":"https://api.github.com/repos/TestFX/TestFX/issues/comments/405877016","html_url":"https://github.com/TestFX/TestFX/pull/591#issuecomment-405877016","issue_url":"https://api.github.com/repos/TestFX/TestFX/issues/591","id":405877016,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTg3NzAxNg==","user":{"login":"brcolow","id":6589866,"node_id":"MDQ6VXNlcjY1ODk4NjY=","avatar_url":"https://avatars1.githubusercontent.com/u/6589866?v=4","gravatar_id":"","url":"https://api.github.com/users/brcolow","html_url":"https://github.com/brcolow","followers_url":"https://api.github.com/users/brcolow/followers","following_url":"https://api.github.com/users/brcolow/following{/other_user}","gists_url":"https://api.github.com/users/brcolow/gists{/gist_id}","starred_url":"https://api.github.com/users/brcolow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brcolow/subscriptions","organizations_url":"https://api.github.com/users/brcolow/orgs","repos_url":"https://api.github.com/users/brcolow/repos","events_url":"https://api.github.com/users/brcolow/events{/privacy}","received_events_url":"https://api.github.com/users/brcolow/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T09:53:37Z","updated_at":"2018-07-18T09:53:37Z","author_association":"COLLABORATOR","body":"When using AWT Robot on Travis, because it is headless, we trigger a `HeadlessException` everytime `getMouseLocation` is called. Also we explicitly throw a `RuntimeException` when trying to create an AWT robot when running heedlessly:\r\n\r\n```\r\n    @Override\r\n    public void robotCreate() {\r\n        if (GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {\r\n            throw new RuntimeException(\"can not create awt robot as environment is headless\");\r\n        }\r\n        Toolkit.getDefaultToolkit(); // initializes awt toolkit\r\n        awtRobot = createAwtRobot();\r\n    }\r\n```\r\n\r\nShould we get rid of the exception (maybe replace it with a warning) and have the `getMouseLocation` method return `(-1, -1)` if running in headless mode? Or should we leave it as is? Unfortunately it is not possible to run in headed mode on macOS on Travis CI."}}
{"actor":{"display_login":"brcolow"}}