Permalink
Browse files

update examples in README

  • Loading branch information...
1 parent 8ec59d8 commit 2a584e973f55e293f01e8448ab19a0444e51804e @madrobby madrobby committed Aug 27, 2011
Showing with 30 additions and 24 deletions.
  1. +30 −24 README.markdown
View
@@ -11,31 +11,37 @@ Two global methods are exposed, `key` for defining shortcuts, and
See `test.html` for a live demo.
```
- key('c', 'issues', function(){
- console.log('c/issues');
- });
+ key('c', 'issues', function(){
+ console.log('c/issues');
+ });
+
+ key('command+r', 'issues', function(){
+ console.log('Hijacked Command+R, damn!');
+ return false;
+ });
- key('i', function(){
- keyScope('issues');
- console.log('Switched to "issues" scope.');
- });
-
- key('i', function(){
- console.log('(example of multiple assignment)');
- });
-
- key('o, enter, left', function(){
- console.log('o, enter or left pressed!');
- });
-
- key('ctrl+c', function(){
- console.log('this is not the command line');
- });
-
- key('⌘+right,shift+left,ctrl+shift+alt+d', function(event){
- console.log('command+right, or shift+left, or ctrl+shift+alt+d');
- event.preventDefault();
- });
+ key('i', function(){
+ keyScope('issues');
+ console.log('Switched to "issues" scope. Command+R is now no longer reloading...');
+ });
+
+ key('i', function(){
+ console.log('(example of multiple assignment)');
+ });
+
+ key('o, enter, left', function(){
+ console.log('o, enter or left pressed!');
+ });
+
+ key('ctrl+c', function(){
+ console.log('this is not the command line');
+ });
+
+ key('⌘+right,shift+left,ctrl+shift+alt+d', function(event){
+ console.log('command+right, or shift+left, or ctrl+shift+alt+d');
+ console.log('here is the event: ', event);
+ return false; // prevent default && stop propagation
+ });
```
TODOs:

0 comments on commit 2a584e9

Please sign in to comment.