comparison 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
comparison
equal deleted inserted replaced
91:19f3bd33277d 92:8e3c1217aad4
1 package alice.test.topology.movement;
2
3 import java.awt.event.KeyEvent;
4 import java.awt.event.KeyListener;
5
6 public class KeyInputCodeSegment implements KeyListener{
7 int KeyCode = 0;
8 SendLocation cs;
9 @Override
10 public void keyPressed(KeyEvent event) {
11 // TODO Auto-generated method stub
12 KeyCode = event.getKeyCode();
13 switch(KeyCode)
14 {
15 case 37:
16 cs = new SendLocation(-1);
17 cs.nowX.setKey("parent", "fish3X");
18 break;
19 case 39:
20 cs = new SendLocation(1);
21 cs.nowX.setKey("parent", "fish3X");
22 break;
23 }
24 }
25
26 @Override
27 public void keyReleased(KeyEvent arg0) {
28 // TODO Auto-generated method stub
29
30 }
31
32 @Override
33 public void keyTyped(KeyEvent arg0) {
34 // TODO Auto-generated method stub
35
36 }
37
38 }