mt6582平台 KCOL0对地的按键如何配置?
KCOL0对地有上另个按键,请问在82上怎么配置啊?
这种配置后要修改软件才可以,还有两个键同时按肯定没办法检测的。
有点麻烦。
按照你这种接法,我提供一个解决方法,兄弟试一下
#if 1
static u16 r0_c0_keycode = KEY_VOLUMEUP; // 定义row0 col0按键
#endif
static void kpd_keymap_handler(unsigned long data)
{
int i, j;
bool pressed;
u16 new_state[KPD_NUM_MEMS], change, mask;
u16 hw_keycode, linux_keycode;
kpd_get_keymap_state(new_state);
for (i = 0; i < KPD_NUM_MEMS; i++) {
change = new_state[i] ^ kpd_keymap_state[i];
if (!change)
continue;
for (j = 0; j < 16; j++) {
mask = 1U << j;
if (!(change & mask))
continue;
hw_keycode = (i << 4) + j;
/* bit is 1: not pressed, 0: pressed */
pressed = !(new_state[i] & mask);
if (kpd_show_hw_keycode) {
printk(KPD_SAY "(%s) HW keycode = %u\n",
pressed ? "pressed" : "released",
hw_keycode);
}
BUG_ON(hw_keycode >= KPD_NUM_KEYS);
linux_keycode = kpd_keymap[hw_keycode];
if (unlikely(linux_keycode == 0)) {
kpd_print("Linux keycode = 0\n");
continue;
}
kpd_aee_handler(linux_keycode, pressed);
kpd_backlight_handler(pressed, linux_keycode);
input_report_key(kpd_input_dev, linux_keycode, pressed);
input_sync(kpd_input_dev);
kpd_print("report Linux keycode = %u\n", linux_keycode);
#if 1
if(r0_c0_keycode == linux_keycode)
{
break;
}
#endif
}
#if 1
if(r0_c0_keycode == linux_keycode)
{
break;
}
#endif
}
memcpy(kpd_keymap_state, new_state, sizeof(new_state));
kpd_print("save new keymap state\n");
enable_irq(MT_KP_IRQ_ID);
}
另外你可以打印下hw_keycode这个值,通过这个值判断col0是哪个键,肯定是可以的。
谢谢仁兄!