请教
this.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent e)
{
if(e.getKeyCode()==KeyEvent.VK_LEFT)
{
dangQianKuai.zuoYi();
}
else if(e.getKeyCode()==KeyEvent.VK_RIGHT)
{
dangQianKuai.youYi();
}
else if(e.getKeyCode()==KeyEvent.VK_DOWN)
{
delay-=50;
}
else if(e.getKeyCode()==KeyEvent.VK_UP)
{
;
}
}
});
编译以上程序敲方向键没反应
请问KeyEvent.类的getKeyCode()方法得到的是键的虚拟码吗?
KeyEvent.VK_RIGHT是RIGHT键的虚拟吗吗?