+ if( X.Dom.Event.toPointer[ _type ] ){\r
+ // Touch or Mouse\r
+ \r
+ /* e.constructor === window.TouchEvent -> e.touches for iOS3.13 */\r
+ if( touches = e.changedTouches ){\r
+ if( touches.length === 0 ){\r
+ alert( 'e.changedTouches.length === 0' );\r
+ };\r
+ xnode._cancelMouse = type;\r
+ \r
+ events = [];\r
+ altKey = e.altKey;\r
+ ctrlKey = e.ctrlKey;\r
+ metaKey = e.metaKey;\r
+ shiftKey = e.shiftKey;\r
+ time = X.getTime();\r
+ for( i = touches.length; i; ){\r
+ touch = touches[ --i ];\r
+ target = touch.target;\r
+ related = touch.relatedTarget;\r
+ events[ i ] = {\r
+ type : type,\r
+ pointerType : 'touch',\r
+ target : Node._getXNode( target.nodeType === 3 ? target.parentNode : target ),// defeat Safari bug // xnodetouch.target,\r
+ currentTarget : xnode,\r
+ relatedTarget : Node._getXNode( related.nodeType === 3 ? related.parentNode : related ), // xnode\r
+ isPrimary : true,\r
+ hwTimestamp : time,\r
+ timestamp : time,\r
+ buttons : e.button,\r
+ buttons : e.buttons || e.button,\r
+ altKey : altKey,\r
+ ctrlKey : ctrlKey,\r
+ metaKey : metaKey,\r
+ shiftKey : shiftKey,\r
+ pointerId : touch.identifier + 2,\r
+ //screenX : touch.screenX,\r
+ //screenY : touch.screenY,\r
+ clientX : touch.clientX,\r
+ clientY : touch.clientY,\r
+ pageX : touch.pageX,\r
+ pageY : touch.pageY,\r
+ offsetX : touch.offsetX, // 要素上の座標を取得 \r
+ offsetY : touch.offsetY,\r
+ radiusX : touch.radiusX || 0,\r
+ radiusY : touch.radiusY || 0,\r
+ rotationAngle : touch.rotationAngle || 0,\r
+ pressure : touch.force || touch.webkitForce || ( isEnd ? 0 : 0.5 ),\r
+ width : touch.width || 0,\r
+ height : touch.height || 0\r
+ };\r
+ };\r
+ return events.length === 1 ? events[ 0 ] : events;\r
+ } else {\r
+ \r
+ if( xnode._cancelMouse === type ){\r
+ delete xnode._cancelMouse;\r
+ return [];\r
+ };\r
+ \r
+ // MouseEvent;\r
+ this.type = type;\r
+ this.pointerType = 'mouse';\r
+ \r
+ // http://www.programming-magic.com/20090127231544/\r
+ // TODO Opera で button==2の場合、コンテキストメニューイベントを発火 「ツール」->「設定」->「詳細設定」->「コンテンツ」->「Javascriptオプション」で「右クリックを制御するスクリプトを許可する」\r
+ this.button = e.button !== undefined ? e.button :\r
+ e.which !== undefined ? e.which - 1 : -1;\r
+ this.buttons = e.buttons !== undefined ? e.buttons : this.button === 0 ? 1 : this.button === 1 ? 2 : this.button === 2 ? 4 : 0;\r
+ this.pressure = ( this.button !== -1 ? 0.5 : 0 );\r
+ \r
+ elm = e.target;\r
+ this.target = Node._getXNode( elm.nodeType === 3 ? elm.parentNode : elm );// defeat Safari bug // xnodetouch.target;\r
+ this.isPrimary = true;\r
+ this.hwTimestamp = this.timestamp = X.getTime(); \r
+ this.altKey = e.altKey;\r
+ this.ctrlKey = e.ctrlKey;\r
+ this.metaKey = e.metaKey;\r
+ this.shiftKey = e.shiftKey;\r
+ this.pointerId = 1;\r
+ //this.screenX = touch.screenX;\r
+ //this.screenY = touch.screenY;\r
+ // TODO http://uupaa-js.googlecode.com/svn-history/r8/trunk/doc/reference/symbols/src/trunk_uu.module.ui.js.html\r
+ // Safari2ではclientX,YはpageX,Yと同じ値を返す\r
+ this.clientX = e.clientX;\r
+ this.clientY = e.clientY;\r
+ this.pageX = e.pageX;\r
+ this.pageY = e.pageY;\r
+ this.offsetX = e.offsetX || e.layerX; // 要素上の座標を取得 \r
+ this.offsetY = e.offsetY || e.layerY;\r
+ };\r