Advertisement
Guest User

SHIFT key support for heatmap-keyboard

a guest
Sep 5th, 2011
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. # adding "shift" support to http://www.patrick-wied.at/projects/heatmap-keyboard/
  2. # crude first cut: left shift only, shifted *letters* only
  3.  
  4. diff --git a/coordinates.js b/coordinates.js
  5. index a5dfb1a..f6c5437 100644
  6. --- a/coordinates.js
  7. +++ b/coordinates.js
  8. @@ -67,7 +67,8 @@ app.COORDINATES = {
  9.      ">": [590, 275],
  10.      "/": [644, 275],
  11.      "?": [644, 275],
  12. -    " ": [500, 300]
  13. +    " ": [500, 300],
  14. +    "LSHIFT": [104 ,275],
  15.  },
  16.  app.EXCLUDES = [" "],
  17.  app.SAMPLE_TEXT = [
  18. diff --git a/index.html b/index.html
  19. index 7f77f8e..125f6ef 100644
  20. --- a/index.html
  21. +++ b/index.html
  22. @@ -131,6 +131,13 @@
  23.                          
  24.                          var key = text.charAt(i);
  25.                          if(/^[A-Za-z]$/.test(key)){
  26. +                            if (/[A-Z]/.test(key)) {
  27. +                                 var joined = app.COORDINATES["LSHIFT"].join(";");
  28. +                                if(!temp[joined])
  29. +                                    temp[joined] = 0;
  30. +                                    
  31. +                                temp[joined] += 1;
  32. +                   }
  33.                              key = key.toUpperCase();
  34.                          }
  35.                          if(app.config.exclude && app.EXCLUDES.indexOf(key) == -1){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement