{"action":"created","issue":{"url":"https://api.github.com/repos/davecparker/code12/issues/48","repository_url":"https://api.github.com/repos/davecparker/code12","labels_url":"https://api.github.com/repos/davecparker/code12/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/davecparker/code12/issues/48/comments","events_url":"https://api.github.com/repos/davecparker/code12/issues/48/events","html_url":"https://github.com/davecparker/code12/issues/48","id":328386606,"node_id":"MDU6SXNzdWUzMjgzODY2MDY=","number":48,"title":"onKeyPress/onKeyRelease Events: Can't test key names with ==","user":{"login":"alias-nicole","id":38896487,"node_id":"MDQ6VXNlcjM4ODk2NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/38896487?v=4","gravatar_id":"","url":"https://api.github.com/users/alias-nicole","html_url":"https://github.com/alias-nicole","followers_url":"https://api.github.com/users/alias-nicole/followers","following_url":"https://api.github.com/users/alias-nicole/following{/other_user}","gists_url":"https://api.github.com/users/alias-nicole/gists{/gist_id}","starred_url":"https://api.github.com/users/alias-nicole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alias-nicole/subscriptions","organizations_url":"https://api.github.com/users/alias-nicole/orgs","repos_url":"https://api.github.com/users/alias-nicole/repos","events_url":"https://api.github.com/users/alias-nicole/events{/privacy}","received_events_url":"https://api.github.com/users/alias-nicole/received_events","type":"User","site_admin":false},"labels":[{"id":919051345,"node_id":"MDU6TGFiZWw5MTkwNTEzNDU=","url":"https://api.github.com/repos/davecparker/code12/labels/fixed","name":"fixed","color":"09c47c","default":false}],"state":"closed","locked":false,"assignee":{"login":"alias-nicole","id":38896487,"node_id":"MDQ6VXNlcjM4ODk2NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/38896487?v=4","gravatar_id":"","url":"https://api.github.com/users/alias-nicole","html_url":"https://github.com/alias-nicole","followers_url":"https://api.github.com/users/alias-nicole/followers","following_url":"https://api.github.com/users/alias-nicole/following{/other_user}","gists_url":"https://api.github.com/users/alias-nicole/gists{/gist_id}","starred_url":"https://api.github.com/users/alias-nicole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alias-nicole/subscriptions","organizations_url":"https://api.github.com/users/alias-nicole/orgs","repos_url":"https://api.github.com/users/alias-nicole/repos","events_url":"https://api.github.com/users/alias-nicole/events{/privacy}","received_events_url":"https://api.github.com/users/alias-nicole/received_events","type":"User","site_admin":false},"assignees":[{"login":"alias-nicole","id":38896487,"node_id":"MDQ6VXNlcjM4ODk2NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/38896487?v=4","gravatar_id":"","url":"https://api.github.com/users/alias-nicole","html_url":"https://github.com/alias-nicole","followers_url":"https://api.github.com/users/alias-nicole/followers","following_url":"https://api.github.com/users/alias-nicole/following{/other_user}","gists_url":"https://api.github.com/users/alias-nicole/gists{/gist_id}","starred_url":"https://api.github.com/users/alias-nicole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alias-nicole/subscriptions","organizations_url":"https://api.github.com/users/alias-nicole/orgs","repos_url":"https://api.github.com/users/alias-nicole/repos","events_url":"https://api.github.com/users/alias-nicole/events{/privacy}","received_events_url":"https://api.github.com/users/alias-nicole/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-06-01T05:28:39Z","updated_at":"2018-07-03T05:11:05Z","closed_at":"2018-07-03T05:11:05Z","author_association":"COLLABORATOR","body":"Key names that appear not to work (when used as part of an if statement) in these two events:\r\n\r\n- \"a\" to \"z\"  (alphabet keys)\r\n- \"0\" to \"9\" (top row number keys)\r\n- \"tab\"\r\n\r\nHowever, they (except for \"tab\") work fine when used in part of a switch statement (see attached test belowfor further details).\r\n\r\n`import Code12.*;\r\n   \r\n   public class MainProgram extends Code12Program\r\n   {\r\n      GameObj circle;\r\n      \r\n      public static void main(String[] args)\r\n      { \r\n         Code12.run(new MainProgram()); \r\n      }\r\n      \r\n      public void start()\r\n      {\r\n         circle = ct.circle(ct.getWidth()/2, ct.getHeight()/2, 10 );   \r\n      }\r\n      \r\n      \r\n      public void onKeyPress(String keyName)\r\n      {\r\n         if ( keyName == \"right\" )  // works\r\n            circle.xSpeed = 1;\r\n            \r\n          if ( keyName == \"w\" )      // does not work\r\n            circle.xSpeed = -1;\r\n            \r\n        // But works as a switch statement\r\n        switch (keyName)\r\n        {\r\n            case \"d\":\r\n               circle.x += 5;\r\n               break;\r\n            case \"a\":\r\n               circle.x -= 5;\r\n        }\r\n        \r\n      }\r\n      \r\n      public void onKeyRelease(String keyName)\r\n      {\r\n         if ( keyName == \"space\" ) // this is one that works\r\n            circle.ySpeed = 1;\r\n   \r\n         if ( keyName == \"up\" )   // also works      \r\n            circle.ySpeed = -1;\r\n            \r\n         if ( keyName == \"a\" )   // does not work\r\n            circle.ySpeed = 10;\r\n         \r\n         // works when used with a switch statement\r\n         // this one tests top row number keys and tab\r\n         switch ( keyName )\r\n         {\r\n            case \"0\":\r\n               circle.y += 5;\r\n               break;\r\n            case \"5\":\r\n               circle.y -= 5;\r\n            case \"tab\":          // does not seem to work\r\n               circle.y = 10;\r\n         }\r\n      }\r\n      \r\n   }\r\n`\r\n "},"comment":{"url":"https://api.github.com/repos/davecparker/code12/issues/comments/402014956","html_url":"https://github.com/davecparker/code12/issues/48#issuecomment-402014956","issue_url":"https://api.github.com/repos/davecparker/code12/issues/48","id":402014956,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjAxNDk1Ng==","user":{"login":"alias-nicole","id":38896487,"node_id":"MDQ6VXNlcjM4ODk2NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/38896487?v=4","gravatar_id":"","url":"https://api.github.com/users/alias-nicole","html_url":"https://github.com/alias-nicole","followers_url":"https://api.github.com/users/alias-nicole/followers","following_url":"https://api.github.com/users/alias-nicole/following{/other_user}","gists_url":"https://api.github.com/users/alias-nicole/gists{/gist_id}","starred_url":"https://api.github.com/users/alias-nicole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alias-nicole/subscriptions","organizations_url":"https://api.github.com/users/alias-nicole/orgs","repos_url":"https://api.github.com/users/alias-nicole/repos","events_url":"https://api.github.com/users/alias-nicole/events{/privacy}","received_events_url":"https://api.github.com/users/alias-nicole/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T05:11:05Z","updated_at":"2018-07-03T05:11:05Z","author_association":"COLLABORATOR","body":"Clarified the usage of == vs .equals"}}
{"actor":{"display_login":"alias-nicole"}}