onkeydown(e: Laya.Event): void{
console.log(e.keyCode);
if(e.keyCode==37){//左
this.hero.pos(this.hero.x-100,this.hero.y);
}else if(e.keyCode==39){//右
this.hero.pos(this.hero.x+100,this.hero.y);
}else if(e.keyCode==38){//上
this.hero.pos(this.hero.x,this.hero.y-100);
}else if(e.keyCode==40){//下
this.hero.pos(this.hero.x,this.hero.y+100);
}
}
搞定了