---
title: "Mootools之自定义事件"
author: "tof.j"
date: "2009-06-23T17:26:39Z"
tags: []
slug: "mootools"
draft: false
lastmod: "2009-06-23T17:26:39Z"
id: 413669
url: "https://tof-j.iteye.com/blog/413669"
---

> //自定义事件shiftclick: 按住shift后鼠标进行点击  
> Element.Events.shiftclick = {  
>     base: 'click', //设置基类事件为click  
>     condition: function(event){ //用来检测其他事件触发条件  
>         return (event.shift == true); //检查是否按了shift键  
>     }  
> };
> 
> $('myInput').addEvent('shiftclick', function(event){  
>     alert('the user clicked the left mouse button while holding the shift key');  
> });