touch拦截监听_如何能监听到TouchStart和TouchEnd事件

Laya.stage.on(Event.MOUSE_UP, this, onApeRelease);

Laya.stage.on(Event.MOUSE_DOWN, this, onApeRelease);

通过 Event  类型 监听动作

class Event {

/** 一个空的 Event 对象。用于事件派发中转使用。*/

static EMPTY: Event;

/** 定义 mousedown 事件对象的 type 属性值。*/

static MOUSE_DOWN: string;

/** 定义 mouseup 事件对象的 type 属性值。*/

static MOUSE_UP: string;

/** 定义 click 事件对象的 type 属性值。*/

static CLICK: string;

/** 定义 rightmousedown 事件对象的 type 属性值。*/

static RIGHT_MOUSE_DOWN: string;

/** 定义 rightmouseup 事件对象的 type 属性值。*/

static RIGHT_MOUSE_UP: string;

/** 定义 rightclick 事件对象的 type 属性值。*/

static RIGHT_CLICK: string;

/** 定义 mousemove 事件对象的 type 属性值。*/

static MOUSE_MOVE: string;

/** 定义 mouseover 事件对象的 type 属性值。*/

static MOUSE_OVER: string;

/** 定义 mouseout 事件对象的 type 属性值。*/

static MOUSE_OUT: string;

/** 定义 mousewheel 事件对象的 type 属性值。*/

static MOUSE_WHEEL: string;

/** 定义 mouseover 事件对象的 type 属性值。*/

static ROLL_OVER: string;

/** 定义 mouseout 事件对象的 type 属性值。*/

static ROLL_OUT: string;

/** 定义 doubleclick 事件对象的 type 属性值。*/

static DOUBLE_CLICK: string;

/** 定义 change 事件对象的 type 属性值。*/

static CHANGE: string;

/** 定义 changed 事件对象的 type 属性值。*/

static CHANGED: string;

/** 定义 resize 事件对象的 type 属性值。*/

static RESIZE: string;

/** 定义 added 事件对象的 type 属性值。*/

static ADDED: string;

/** 定义 removed 事件对象的 type 属性值。*/

static REMOVED: string;

/** 定义 display 事件对象的 type 属性值。*/

static DISPLAY: string;

/** 定义 undisplay 事件对象的 type 属性值。*/

static UNDISPLAY: string;

/** 定义 error 事件对象的 type 属性值。*/

static ERROR: string;

/** 定义 complete 事件对象的 type 属性值。*/

static COMPLETE: string;

/** 定义 loaded 事件对象的 type 属性值。*/

static LOADED: string;

/** 定义 progress 事件对象的 type 属性值。*/

static PROGRESS: string;

/** 定义 input 事件对象的 type 属性值。*/

static INPUT: string;

/** 定义 render 事件对象的 type 属性值。*/

static RENDER: string;

/** 定义 open 事件对象的 type 属性值。*/

static OPEN: string;

/** 定义 message 事件对象的 type 属性值。*/

static MESSAGE: string;

/** 定义 close 事件对象的 type 属性值。*/

static CLOSE: string;

/** 定义 keydown 事件对象的 type 属性值。*/

static KEY_DOWN: string;

/** 定义 keypress 事件对象的 type 属性值。*/

static KEY_PRESS: string;

/** 定义 keyup 事件对象的 type 属性值。*/

static KEY_UP: string;

/** 定义 frame 事件对象的 type 属性值。*/

static FRAME: string;

/** 定义 dragstart 事件对象的 type 属性值。*/

static DRAG_START: string;

/** 定义 dragmove 事件对象的 type 属性值。*/

static DRAG_MOVE: string;

/** 定义 dragend 事件对象的 type 属性值。*/

static DRAG_END: string;

/** 定义 enter 事件对象的 type 属性值。*/

static ENTER: string;

/** 定义 select 事件对象的 type 属性值。*/

static SELECT: string;

/** 定义 blur 事件对象的 type 属性值。*/

static BLUR: string;

/** 定义 focus 事件对象的 type 属性值。*/

static FOCUS: string;

/** 定义 visibilitychange 事件对象的 type 属性值。*/

static VISIBILITY_CHANGE: string;

/** 定义 focuschange 事件对象的 type 属性值。*/

static FOCUS_CHANGE: string;

/** 定义 played 事件对象的 type 属性值。*/

static PLAYED: string;

/** 定义 paused 事件对象的 type 属性值。*/

static PAUSED: string;

/** 定义 stopped 事件对象的 type 属性值。*/

static STOPPED: string;

/** 定义 start 事件对象的 type 属性值。*/

static START: string;

/** 定义 end 事件对象的 type 属性值。*/

static END: string;

/** 定义 enablechanged 事件对象的 type 属性值。*/

static ENABLE_CHANGED: string;

/** 定义 activeinhierarchychanged 事件对象的 type 属性值。*/

static ACTIVE_IN_HIERARCHY_CHANGED: string;

/** 定义 componentadded 事件对象的 type 属性值。*/

static COMPONENT_ADDED: string;

/** 定义 componentremoved 事件对象的 type 属性值。*/

static COMPONENT_REMOVED: string;

/** 定义 layerchanged 事件对象的 type 属性值。*/

static LAYER_CHANGED: string;

/** 定义 hierarchyloaded 事件对象的 type 属性值。*/

static HIERARCHY_LOADED: string;

/** 定义 recovering 事件对象的 type 属性值。*/

static RECOVERING: string;

/** 定义 recovered 事件对象的 type 属性值。*/

static RECOVERED: string;

/** 定义 released 事件对象的 type 属性值。*/

static RELEASED: string;

/** 定义 link 事件对象的 type 属性值。*/

static LINK: string;

/** 定义 label 事件对象的 type 属性值。*/

static LABEL: string;

/**浏览器全屏更改时触发*/

static FULL_SCREEN_CHANGE: string;

/**显卡设备丢失时触发*/

static DEVICE_LOST: string;

/**模型更换时触发*/

static MESH_CHANGED: string;

/**材质更换时触发*/

static MATERIAL_CHANGED: string;

/**渲染队列更换时触发*/

static RENDERQUEUE_CHANGED: string;

/**世界矩阵更新时触发。*/

static WORLDMATRIX_NEEDCHANGE: string;

/**更换动作时触发。*/

static ANIMATION_CHANGED: string;

/** 事件类型。*/

type: string;

/** 原生浏览器事件。*/

nativeEvent: any;

/** 事件目标触发对象。*/

target: laya.display.Sprite;

/** 事件当前冒泡对象。*/

currentTarget: laya.display.Sprite;

_stoped: boolean;

/** 分配给触摸点的唯一标识号(作为 int)。*/

touchId: number;

/**键盘值*/

keyCode: number;

/**滚轮滑动增量*/

delta: number;

/**

* 设置事件数据。

* @param    type 事件类型。

* @param    currentTarget 事件目标触发对象。

* @param    target 事件当前冒泡对象。

* @return 返回当前 Event 对象。

*/

setTo(type: string, currentTarget: laya.display.Sprite, target: laya.display.Sprite): Event;

/**

* 防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。

*/

stopPropagation(): void;

/**

* 触摸点列表。

*/

touches: Array;

/**

* 表示 Alt 键是处于活动状态 (true) 还是非活动状态 (false)。

*/

altKey: boolean;

/**

* 表示 Ctrl 键是处于活动状态 (true) 还是非活动状态 (false)。

*/

ctrlKey: boolean;

/**

* 表示 Shift 键是处于活动状态 (true) 还是非活动状态 (false)。

*/

shiftKey: boolean;

/**

* 包含按下或释放的键的字符代码值。字符代码值为英文键盘值。

*/

charCode: boolean;

/**

* 表示键在键盘上的位置。这对于区分在键盘上多次出现的键非常有用。

* 例如,您可以根据此属性的值来区分左 Shift 键和右 Shift 键:左 Shift 键的值为 KeyLocation.LEFT,右 Shift 键的值为 KeyLocation.RIGHT。另一个示例是区分标准键盘 (KeyLocation.STANDARD) 与数字键盘 (KeyLocation.NUM_PAD) 上按下的数字键。

*/

keyLocation: number;

/**鼠标在 Stage 上的 X 轴坐标*/

stageX: number;

/**鼠标在 Stage 上的 Y 轴坐标*/

stageY: number;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值