안드로이드 개발 질문/답변
(글 수 45,052)
사실 keyevent를 c (adb shell)에서 보내고 싶습니다.
하지만 physical 키보드가 없는 device들은 키보드 driver가 안깔려 있어
sendevent /dev/input/event0 1 30 1
sendevent /dev/input/event0 1 30 0
뭐 이렇게 보내도 keyevent를 보내지를 않더라고요.
키보드 드라이버를 만드는 방법을 아무리 읽어봐도 도무지 이해가 안가는게요:
#include <linux/input.h>
...
button_dev = input_allocate_device();
input_event(button_dev, EV_KEY, BTN_0, !!10);
...
요런 command를 사용해서 드라이버를 만들라고 하는데,
#include <linux/input.h>
해도 build를 할때 input_allocate_device(), input_event() 이
undefined라고 컴파일이 되지 않아요.
혹시 드라이버를 만들지 않고도 c에서 JVM에게 keyevent를 보낼수 있는 방법이 없을까요?
감사합니다.