{"action":"created","issue":{"url":"https://api.github.com/repos/google/blockly/issues/171","labels_url":"https://api.github.com/repos/google/blockly/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/google/blockly/issues/171/comments","events_url":"https://api.github.com/repos/google/blockly/issues/171/events","html_url":"https://github.com/google/blockly/pull/171","id":105029982,"number":171,"title":"Add option to disable keyboard shortcuts","user":{"login":"andersschuller","id":1851477,"avatar_url":"https://avatars.githubusercontent.com/u/1851477?v=3","gravatar_id":"","url":"https://api.github.com/users/andersschuller","html_url":"https://github.com/andersschuller","followers_url":"https://api.github.com/users/andersschuller/followers","following_url":"https://api.github.com/users/andersschuller/following{/other_user}","gists_url":"https://api.github.com/users/andersschuller/gists{/gist_id}","starred_url":"https://api.github.com/users/andersschuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersschuller/subscriptions","organizations_url":"https://api.github.com/users/andersschuller/orgs","repos_url":"https://api.github.com/users/andersschuller/repos","events_url":"https://api.github.com/users/andersschuller/events{/privacy}","received_events_url":"https://api.github.com/users/andersschuller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-05T14:41:49Z","updated_at":"2015-09-13T02:51:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/blockly/pulls/171","html_url":"https://github.com/google/blockly/pull/171","diff_url":"https://github.com/google/blockly/pull/171.diff","patch_url":"https://github.com/google/blockly/pull/171.patch"},"body":"In our game built on Blockly, we would like to be able to disable the keyboard shortcuts (delete,  cut, copy, paste, and so on). Currently it seems the only way to achieve this is to override `Blockly.onKeyDown_`, so this change adds a `keyboardShortcuts` option which can be used to prevent Blockly from binding to keyboard events. The usage and handling of this option is similar to the existing `sounds` option.\r\n\r\nI don't think there were any existing tests for the handling of options, so I added a few test cases for `Blockly.parseOptions_` - first for the `sounds` option, then for the new `keyboardShortcuts` option.\r\n\r\nThere is currently no test for the changes to `Blockly.init_` where the new option is actually checked for, however I did not see any similar tests that covered creating an actual workspace. I did however manually test that the change worked by modifying the options in `playground.html`.\r\n\r\nThis new option would eventually also require a change to the [list of options in the documentation](https://developers.google.com/blockly/installation/overview#configuration).\r\n\r\nPlease let me know if you have any questions or feedback."},"comment":{"url":"https://api.github.com/repos/google/blockly/issues/comments/139840644","html_url":"https://github.com/google/blockly/pull/171#issuecomment-139840644","issue_url":"https://api.github.com/repos/google/blockly/issues/171","id":139840644,"user":{"login":"NeilFraser","id":250480,"avatar_url":"https://avatars.githubusercontent.com/u/250480?v=3","gravatar_id":"","url":"https://api.github.com/users/NeilFraser","html_url":"https://github.com/NeilFraser","followers_url":"https://api.github.com/users/NeilFraser/followers","following_url":"https://api.github.com/users/NeilFraser/following{/other_user}","gists_url":"https://api.github.com/users/NeilFraser/gists{/gist_id}","starred_url":"https://api.github.com/users/NeilFraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeilFraser/subscriptions","organizations_url":"https://api.github.com/users/NeilFraser/orgs","repos_url":"https://api.github.com/users/NeilFraser/repos","events_url":"https://api.github.com/users/NeilFraser/events{/privacy}","received_events_url":"https://api.github.com/users/NeilFraser/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T02:51:30Z","updated_at":"2015-09-13T02:51:30Z","body":"Wow, looks perfect.  Unit tests...that's something I've never seen submitted before!\r\n\r\nOne question is whether you really want to disable the trapping of the delete key.  The default browser behaviour is to navigate to the previous page, destroying your work in Blockly.  Is this what you intend?  Can you tell me a bit about your use case?  Thanks!"}}