Mercurial > hg > Members > tatsuki > Alice
view src/alice/test/topology/movement/KeyInputCodeSegment.java @ 92:8e3c1217aad4 working
add KeyInput
author | sugi |
---|---|
date | Tue, 05 Jun 2012 14:31:04 +0900 |
parents | |
children | 6601f8854126 |
line wrap: on
line source
package alice.test.topology.movement; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class KeyInputCodeSegment implements KeyListener{ int KeyCode = 0; SendLocation cs; @Override public void keyPressed(KeyEvent event) { // TODO Auto-generated method stub KeyCode = event.getKeyCode(); switch(KeyCode) { case 37: cs = new SendLocation(-1); cs.nowX.setKey("parent", "fish3X"); break; case 39: cs = new SendLocation(1); cs.nowX.setKey("parent", "fish3X"); break; } } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } }