File: mouse.js

package info (click to toggle)
freej 0.10git20100110-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 32,080 kB
  • ctags: 22,705
  • sloc: cpp: 156,254; ansic: 25,531; sh: 13,538; perl: 4,624; makefile: 3,278; python: 2,889; objc: 1,284; asm: 1,125; ruby: 126
file content (23 lines) | stat: -rw-r--r-- 515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

geo = new GeometryLayer();
geo.activate(true);
geo.color(255,255,255,255);
add_layer(geo);


m = new MouseController();
m.activate(true);
// MouseController.button(button, state, x, y)
m.button = function(b, s, x, y) {
    //	echo("b"+b+" s"+s+" x"+x+" y"+y);
	this.grab(s);
}

// MouseController.motion(buttonmask, x, y, xrel, yrel)
m.motion = function(b, x, y, dx, dy) {
    geo.pixel(x,y);
    //    geo.ellipse_fill(x,y,dx,dy);
    //    echo("b"+b+" x"+x+" y"+y+" dx"+dx+" dy"+dy);
}

register_controller(m);