java - Get keycode of input.h linux from KeyCode KeyEvent Android -
i need keycode corresponding structure linux/input.h after keyevent android.
i'm simulating keyboard in jni android. here part of code code :
void keyboardpress(int character) { memset(&ev, 0, sizeof(struct input_event)); ev.type = ev_key; ev.code = character; ev.value = ev_pressed; write(fd, &ev, sizeof(struct input_event)); dev_uinput_sync(fd); ev.type = ev_key; ev.code = character; ev.value = ev_released; write(fd, &ev, sizeof(struct input_event)); dev_uinput_sync(fd);
}
the value character
must value struct linux/input.h example if press 'q', in java code value :
public static final int keycode_q = 45;
the value of 'q' in linux/input.h :
#define key_q 16
is possible value of linux/input.h of character java code or convert java keyevent code linux/input.h code ?
thank !
Comments
Post a Comment