Archive for May, 2007

May 22
will wpf just become pf?
posted by mike at 6:46 am

so I was thinking about this on my run last night, and then saw this post, which compared silverlight/apollo/flex. I think the author is almost there and missing it a bit. One of the things im siked about silverlight for is the cross platform clr. Now think for a second, if they have ported “part” of the clr for silverlight, how hard would it be to port “more” of it to os x. If apollo is a container to run applications on their virtual machine, .the cross platform clr is a true vm framework waiting to happen. To me it would only make sense for ms to port some more functionality, and introduce WPF minus the windows. It would be a natural transition to allow silverlight apps to run outside of the container of the browser on any platform. The question is will ms be smart enough businesswise to allows its engineers to do what they’ve probably been thinking about all along.

 
May 16
hotkeys like hotpants
posted by mike at 3:24 pm

sooo.... a coworker was joking about wanting to do a hotkey easter egg in an application.... I dont take these jokes lightly so I started hacking.... heres a nice little hotkey to js function

JAVASCRIPT:
  1. keyActions=new Array();
  2.  
  3. function EventInfo(e)
  4. {
  5.     if (!e) e = window.event;
  6.     this.KeyPress = String.fromCharCode(e.keyCode);
  7.     this.Key = String.fromCharCode(e['keyCode']);
  8.     this.KeyCode = e['keyCode'];
  9.     this.Alt = e['altKey'];
  10.     this.Shift = e['shiftKey'];
  11.     this.Ctrl = e['ctrlKey'];
  12. }
  13.  
  14. function hotKeys(fields)
  15. {
  16.     if(fields.constructor.toString().indexOf("Array") != -1){
  17.         keyActions=fields;
  18.     }
  19.     else{
  20.         var action = fields.split("|");
  21.         for(var i = 0;i<action.length;i++){
  22.             var key = action[i].split("^")[0];
  23.             var code = action[i].split("^")[1];
  24.             keyActions[i] = {character:  key, js:code};
  25.         }
  26.     }
  27.  
  28. }
  29. hotKeys.prototype = {
  30.     execute:function(e) {
  31.         EInfo = new EventInfo(e);
  32.         if (EInfo) {   
  33.             if (EInfo.Ctrl || EInfo.Alt){
  34.                 for (var i = 0; i <keyActions.length; i++){
  35.                     if (keyActions[i].character == EInfo.KeyPress) {
  36.                         var action;
  37.                         action = new Function (keyActions[i].js);
  38.                         action ();
  39.                         break;
  40.                     }
  41.                 }
  42.             }
  43.         }
  44.     }   
  45. }

then in the html do this

HTML:
  1. <script language="javascript" src="hotkeys.js"></script>
  2. <script language="javascript">
  3. h = new hotKeys("I^openWindow()");
  4. document.onkeyup = h.execute;
  5. </script>
  6. </head>

good times