X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F03_XDomEvent.js;h=391cdb9667a891f2a009ae13ca72454e6281acd3;hb=475df4df9670f042764a99c80d7716e994d28033;hp=07886c0149e4b2e56ee32e507cef83b1334e0b74;hpb=e28511741c97176b8ffe67bb1ea0660da37f754b;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/03_XDomEvent.js b/0.6.x/js/02_dom/03_XDomEvent.js index 07886c0..391cdb9 100644 --- a/0.6.x/js/02_dom/03_XDomEvent.js +++ b/0.6.x/js/02_dom/03_XDomEvent.js @@ -213,11 +213,12 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ } else { // Other - this[ 'keyCode' ] = e.keyCode || e.which; - this[ 'altKey' ] = e.altKey; - this[ 'ctrlKey' ] = e.ctrlKey; - this[ 'shiftKey' ] = e.shiftKey; - this[ 'metaKey' ] = e.metaKey; + this[ 'keyCode' ] = X_Type_isFinite( e.keyCode ) ? e.keyCode : X_Type_isFinite( e.charCode ) ? e.charCode : e.which; + this[ 'charCode' ] = X_Type_isFinite( e.charCode ) ? e.charCode : e.which; + this[ 'altKey' ] = e.altKey || !!( e.modifiers & 1 ); + this[ 'ctrlKey' ] = e.ctrlKey || !!( e.modifiers & 2 ); + this[ 'shiftKey' ] = e.shiftKey || !!( e.modifiers & 4 ); + this[ 'metaKey' ] = e.metaKey || !!( e.modifiers & 8 );; this[ 'button' ] = e.button !== undefined ? e.button : e.which !== undefined ? e.which - 1 : -1; @@ -272,9 +273,11 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ if( this[ 'target' ] && !this[ 'target' ][ '_tag' ] ) this[ 'target' ] = this[ 'target' ].parent; // ie4 の fake Textnode がヒットしていないか? this[ 'currentTarget' ] = xnode; // xnode this[ 'relatedTarget' ] = X_Node_getXNode( e.formElement || e.toElement ); // xnode + this[ 'relatedTarget' ] && console.dir( 'relatide...' ); this[ 'eventPhase' ] = e.srcElement === element ? 2: 3; this[ 'keyCode' ] = e.keyCode; + this[ 'charCode' ] = e.keyCode; this[ 'altKey' ] = e.altKey; this[ 'ctrlKey' ] = e.ctrlKey; this[ 'shiftKey' ] = e.shiftKey;