@:native("HTMLButtonElement")
extern class ButtonElement extends Element
{
function addEventListener( type : MouseEventType, listener : Event<MouseEventType
> -> Void, ?useCapture : Bool ) : Void;
function removeEventListener( type : MouseEventType, listener : Event<MouseEventType
> -> Void
, ?useCapture : Bool ) : Void;
}
typedef MouseEvent
= Event<MouseEvent
Type>;
@:enum abstract MouseEvent
Type
(String) from String to String {
var CLICK='click';
var MOUSE_MOVE='mousemove';
var MOUSE_DOWN='mousedown';
var MOUSE_UP='mouseup';
var MOUSE_OUT='mouseout';
var MOUSE_OVER='mouseover';
var SCROLL='scroll';
}
class MouseEventType {
static public inline var CLICK:String='click';
static public inline var MOUSE_MOVE:String='mousemove';
static public inline var MOUSE_DOWN:String='mousedown';
static public inline var MOUSE_UP:String='mouseup';
static public inline var MOUSE_OUT:String='mouseout';
static public inline var MOUSE_OVER:String='mouseover';
static public inline var SCROLL:String='scroll';
}
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Hey,
We wanted to do something like that in hxnodejs,
Nicolas gave us some pretty awesome ideas, which you can read here:
https://github.com/HaxeFoundation/hxnodejs/issues/21
I agree it would be great to use the same pattern in "browser" js externs.
Best
Clément