view src/alice/test/topology/aquarium/KeyInputCodeSegment.java @ 138:87f1a30a8c82 working

change range automatic
author sugi
date Tue, 18 Sep 2012 11:46:38 +0900
parents 53aff28cde6b
children b51d3bf971e7
line wrap: on
line source

package alice.test.topology.aquarium;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class KeyInputCodeSegment implements KeyListener{
		
	@Override
	public void keyPressed(KeyEvent event) {
		switch(event.getKeyCode())
		{
		case 37: // left
			new SendLocation(-0.1f,0.0f); 
			break;
		case 38: // up
			new SendLocation(0.0f,0.1f);
			break;
		case 39: // right
			new SendLocation(0.1f,0.0f);
			break;
		case 40: // down
			new SendLocation(0.0f,-0.1f);
			break;
		}
	}

	@Override
	public void keyReleased(KeyEvent event) {
		
	}

	@Override
	public void keyTyped(KeyEvent event) {
		
	}

}