1.新增如下functrion:
/*****************************************************************************
* FUNCTION
* jvm_dummy_key_hdlr
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void jvm_dummy_key_hdlr(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
}
2.reg KEY_ENTER dummy func to make KEY_ENTER not to map
void jvm_register_keypad(kal_bool is_resume)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 keyCode = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
endKeyPressed = KAL_FALSE;
ClearAllKeyHandler();
clear_left_softkey();
clear_right_softkey();
register_default_hide_softkeys();
/* enable 2 or 3 key simultanenous detection */
#ifdef __TWO_KEY_DETECTION_SWITCHABLE__
mmi_kbd_set_concurrent_mode(CONCURRENT_KEY_MODE_2_KEYS);
#elif defined(__THREE_KEY_DETECTION_SWITCHABLE__)
mmi_kbd_set_concurrent_mode(CONCURRENT_KEY_MODE_3_KEYS);
#endif
if (is_resume)
{
jvm_keypad_is_first_resume = KAL_TRUE;
jvm_keypad_ring_buffer_reader = 0;
jvm_keypad_ring_buffer_writer = 0;
jvm_keypad_ring_buffer_size = 0;
endKeyPressed = KAL_FALSE;
set_left_softkey_label((UI_string_type) jui_softkey_label[0]);
set_right_softkey_label((UI_string_type) jui_softkey_label[1]);
if (jvm_keypad_event_notifier_cb_ptr)
{
kal_uint16 keycode;
kal_uint16 keytype;
while (jvm_keypad_fetch(&keycode, &keytype))
{
(*jvm_keypad_event_notifier_cb_ptr)(keycode, keytype);
}
}
}
else
{
int i;
jui_softkey_label[0][0] = 0;
jui_softkey_label[0][1] = 0;
jui_softkey_label[1][0] = 0;
jui_softkey_label[1][1] = 0;
set_left_softkey_label((UI_string_type) jui_softkey_label[0]);
set_right_softkey_label((UI_string_type) jui_softkey_label[1]);
jvm_keypad_is_first_enter = KAL_TRUE;
last_down_key_num = 0;
for (i = 0; i < KEY_DOWN_NUM; i++)
{
last_down_code[i] = -1;
}
}
jvm_keypad_flush();
#if (defined(__MMI_QWERTY_KEYPAD_SUPPORT__) )
mmi_frm_set_app_translate_key_handler(jvm_qwerty_keypad_handler);
/* reg KEY_ENTER dummy func to make KEY_ENTER not to map */
SetKeyHandler((FuncPtr) jvm_dummy_key_hdlr, KEY_ENTER, KEY_EVENT_UP);
SetKeyHandler((FuncPtr) jvm_dummy_key_hdlr, KEY_ENTER, KEY_EVENT_DOWN);
#else
for (keyCode = 0; keyCode < MAX_KEYS; keyCode++)
{
SetKeyHandler((FuncPtr) jvm_normal_keypad_handler, keyCode, KEY_EVENT_UP);
SetKeyHandler((FuncPtr) jvm_normal_keypad_handler, keyCode, KEY_EVENT_DOWN);
SetKeyHandler((FuncPtr) jvm_normal_keypad_handler, keyCode, KEY_EVENT_REPEAT);
SetKeyHandler((FuncPtr) jvm_normal_keypad_handler, keyCode, KEY_EVENT_LONG_PRESS);
}
#endif
}
标签:center,keypad,menu,LSK,label,KEY,softkey,jvm,keyCode
From: https://blog.51cto.com/u_15170706/6167065