/*********************************************************************************/
code KbdTabStruct KeyTab[]={
// |-----------> Index
// | ok
// | | esc
// | | | up
// | | | | down --->功能函数
// | | | | | |
{ 0, 5, 1, 20, 10,(*DispMenuMainZhuji)},// 待机画面
{ 1, 0, 0, 20, 10,(*DispMenuNull)},
{ 2, 0, 0, 0, 0,(*DispMenuNull)},
{ 3, 0, 0, 0, 0,(*DispMenuNull)},
{ 4, 0, 0, 0, 0,(*DispMenuNull)},
{ 5, 6, 7, 8, 9,(*DispMenuZhujiNum)}, // 主
{ 6, 9, 0, 9, 9,(*DispMenuNull)}, // DispMenuZhuji
{ 7, 0, 0, 0, 0,(*DispMenuMainZhuji)}, //
{ 8, 0, 0, 0, 0,(*DispMenuNull)}, //
{ 9, 0, 0, 0, 0,(*DispMenuNull)},//
// ok esc up down
{10,11,12, 0,15,(*DispMenuGongfang)}, //功
{11,14,13,14,14,(*DispMenuGongfangNum)}, //
{12, 0, 0, 0, 0,(*DispMenuNull)}, //
{13, 0, 0, 0, 0,(*DispMenuGongfang)}, //
{14, 0, 0, 0, 0,(*DispMenuNull)},//
{15,16,17,10,20,(*DispMenuLaba)}, //喇
{16,19,18,19,19,(*DispMenuLabaNum)}, //
{17, 0, 0, 0, 0,(*DispMenuNull)}, //
{18, 0, 0, 0, 0,(*DispMenuLaba)}, //
{19, 0, 0, 0, 0,(*DispMenuNull)},//
{20,21,22,15,0,(*DispMenuDiyin)}, // 低
{21, 24, 23, 24, 24,(*DispMenuDiyinNum)}, //
{22, 0, 0, 0, 0,(*DispMenuNull)}, //
{23, 0, 0, 0, 0,(*DispMenuDiyin)}, //
{24, 0, 0, 0, 0,(*DispMenuNull)},//
};
switch(key)
{
case KEY_OK:{ //向上键,找出新的菜单状态编号
KeyFuncIndex=KeyTab[KeyFuncIndex].KeyUpState;
KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate;
(*KeyFuncPtr)();//执行当前按键的操作
break;
}
case KEY_ESC:{ //向下键,找出新的菜单状态编号
KeyFuncIndex=KeyTab[KeyFuncIndex].KeyDnState;
KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate;
(*KeyFuncPtr)();//执行当前按键的操作
break;
}
case KEY_UP:{ //向左键,找出新的菜单状态编号
KeyFuncIndex=KeyTab[KeyFuncIndex].KeyLState;
KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate;
(*KeyFuncPtr)();//执行当前按键的操作
break;
}
case KEY_DOWN:{ //向右键,找出新的菜单状态编号
KeyFuncIndex=KeyTab[KeyFuncIndex].KeyRState;
KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate;
(*KeyFuncPtr)();//执行当前按键的操作
break;
}
文章评论(0条评论)
登录后参与讨论