vis_files/init.js
/// This sets up listeners for the mouse and keys
This sets up listeners for the mouse and keys
This sets up listeners for the mouse and keys
function init_mouse_key()
{
	a = ById("main");
	a.addEventListener('mousemove', function(evt) {
		var mousePos = getMousePos(myc, evt);
		mousemove(mousePos.x,mousePos.y);
	}, false);
	a.addEventListener('mousedown', function(evt) {
		var mousePos = getMousePos(myc, evt);
		mdown(mousePos.x,mousePos.y); 
	}, false);
	a.addEventListener ("mouseout", function(evt) {
		drag = 0; 
		buttoninit();
	}, false);
	a.addEventListener('mouseup', function(evt) {
		var mousePos = getMousePos(myc, evt); 
		ctrlkey = evt.ctrlKey;
		if(evt.altKey) location.reload(true);
		mup(mousePos.x,mousePos.y);
	}, false);
	document.onkeydown = checkKey;
}
function init_mouse_key ( ) { a = ById ( "main" ) ; a . addEventListener ( 'mousemove' , function ( evt ) { var mousePos = getMousePos ( myc , evt ) ; mousemove ( mousePos . x , mousePos . y ) ; } , false ) ; a . addEventListener ( 'mousedown' , function ( evt ) { var mousePos = getMousePos ( myc , evt ) ; mdown ( mousePos . x , mousePos . y ) ; } , false ) ; a . addEventListener ( "mouseout" , function ( evt ) { drag = 0 ; buttoninit ( ) ; } , false ) ; a . addEventListener ( 'mouseup' , function ( evt ) { var mousePos = getMousePos ( myc , evt ) ; ctrlkey = evt . ctrlKey ; if ( evt . altKey ) location . reload ( true ) ; mup ( mousePos . x , mousePos . y ) ; } , false ) ; document . onkeydown = checkKey ; }
This sets up listeners for the mouse and keys
This sets up listeners for the mouse and keys