Mercurial > hg > Database > Alice
view src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java @ 467:6e304a7a60e7 dispose
remove white space
author | sugi |
---|---|
date | Sat, 22 Nov 2014 12:08:24 +0900 |
parents | aefbe41fcf12 |
children | f3f7e256ee03 |
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{ MakeFrame frame; public KeyInputCodeSegment(MakeFrame frame) { this.frame = frame; } @Override public void keyPressed(KeyEvent event) { //System.out.println(event.getKeyCode()); switch(event.getKeyCode()) { case 37: // left new SendLocation(-0.1f,0.0f,0.0f); break; case 38: // up new SendLocation(0.0f,0.1f,0.0f); break; case 39: // right new SendLocation(0.1f,0.0f,0.0f); break; case 40: // down new SendLocation(0.0f,-0.1f,0.0f); break; case 76: // l new SendLocation(0.0f,0.0f,0.1f); break; case 78: // "n" new RefreshWindow(frame); break; case 79: // "o" new SendLocation(0.0f,0.0f,-0.1f); break; case 82: // "r" new ResetFish().execute(); break; } } @Override public void keyReleased(KeyEvent event) { } @Override public void keyTyped(KeyEvent event) { } }