extern void beep(void);
void my_select_key_check(u16 x,u16 y,u16 itemwidth,u16 itemheight,u8 itemsize)
{
u8 key = 0;
static u8 h_btn_count = 0;
u8 h_sta = 0;
key = KEY_Scan(0);
if(key>0) beep();
if(key == WKUP_PRES) //向上 和 确认按钮
{
if(h_btn_count <= 1)
{
h_btn_count = 1;
}
else
{
h_btn_count --;
}
ms_key_sta = 1;
h_sta = 1;
}
else if(key == KEY1_PRES) //向下
{
h_btn_count ++;
if(h_btn_count >= itemsize) //3下移最大距离为条目数大小
{
h_btn_count = itemsize; //3
}
ms_key_sta = 1;
h_sta = 1;
}
else if(key == 67) //按下了确定按钮 speed键
{
ms_keyd_sta = 1;
}
else if(key == 59) //按下了取消按钮 mode键
{
ms_keyr_sta = 1;
}
下面是条目加选项框,想要在按过上下键后再按取消钮能回到确定按钮所按下的位置