92
|
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 }
|