/****************
* 触摸屏 *
* *************/
protected int getPointerKey(int x,int y)
{
int scrH=240;
int key = -100;
if(inRect(x,y,65,10+scrH,30,15)){
key=49;
}
if(inRect(x,y,100,9+scrH,43,14)){
key=50;///KEY_2;
}
else if(inRect(x,y,145,10+scrH,30,15)){
key=51;
}
else if(inRect(x,y,65,30+scrH,23,23)){
key=52;// ///4;
}
else if(inRect(x,y,92,26+scrH,57,26)){
key=53;
}
else if(inRect(x,y,152,30+scrH,23,23)){
key=54;//6;
}
else if(inRect(x,y,65,55+scrH,30,25)){
key = 55;//KEY_7
}
else if(inRect(x,y,100,55+scrH,43,25)){
key=56;///KEY_8;
}
else if(inRect(x,y,145,55+scrH,43,25)){
key=57;
}
// else if (inRect(x,y,65,70+scrH,30,15)){
// key=KEY_STAR;
// }
// else if (inRect(x,y,100,70+scrH,43,15)){
// key=KEY_NUM0;
// }
// else if (inRect(x,y,145,70+scrH,43,15)){
// key=KEY_POUND;
// }
else if (inRect(x,y,10,-30+scrH,40,65)){
key=-6;
}
else if (inRect(x,y,190,-30+scrH,30,65)){
key=-7;
}
return key;
}
protected boolean inRect(int ptx,int pty,int x,int y,int width,int height)
{
if((ptx>x)&&(ptx<x+width)&&(pty>y)&&(pty<y+height))
return true;
else
return false;
}
public int anjian = 9999;
protected void pointerPressed(int x,int y)
{
keyPressed(getPointerKey(x,y));
anjian = getPointerKey(x,y);
}
protected void pointerReleased(int x, int y )
{
keyReleased(anjian);
anjian = 9999;
// keyReleased(getPointerKey(x,y));
}