Skip to content

Commit

Permalink
Tweeked and tested. Works perfectly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Jan 16, 2013
1 parent 14dcafd commit 105c294
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
2 changes: 2 additions & 0 deletions pikeyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ int main(int argc, char *argv[])
init_config();
//test_config(); exit(0);

printf("init uinput\n");

if(init_uinput() == 0){
sleep(1);
//test_uinput();
Expand Down
56 changes: 30 additions & 26 deletions pikeyd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@
# {keycode from /usr/include/linux/input.h} {GPIO pin no}
# Not limited to a single key. A GPIO press will emit all defined keys in order.

KEY_LEFT 0
KEY_RIGHT 1
KEY_UP 4
KEY_DOWN 7
KEY_W 0
KEY_A 1
KEY_S 4
KEY_D 7
KEY_1 8
KEY_2 9
KEY_3 10
KEY_4 11
KEY_5 14
KEY_6 15
KEY_7 17
KEY_8 18
KEY_9 21
KEY_0 22
KEY_MINUS 23
KEY_EQUAL 24
KEY_ESC 25
KEY_H 21
KEY_E 21
KEY_L 21
KEY_L 21
KEY_O 21
KEY_UP 18
KEY_DOWN 4
KEY_LEFT 17
KEY_RIGHT 22
#KEY_W 18
#KEY_A 4
#KEY_S 17
#KEY_D 22
KEY_ESC 7
KEY_5 8
KEY_1 25
KEY_2 11
#KEY_ENTER 11

#type 'advmenu'
#KEY_A 25
#KEY_D 25
#KEY_V 25
#KEY_M 25
#KEY_E 25
#KEY_N 25
#KEY_U 25

KEY_LEFTCTRL 24
KEY_LEFTALT 10
KEY_SPACE 23
#KEY_ENTER 23
#KEY_TAB 23
#KEY_4 9


4 changes: 2 additions & 2 deletions uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ int init_uinput(void)
struct uinput_user_dev uidev;
int i;

fd = open("/dev/input/uinput", O_WRONLY | O_NONBLOCK);
fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
if(fd < 0)
die("error: open");
die("/dev/uinput");

if(ioctl(fd, UI_SET_EVBIT, EV_KEY) < 0)
die("error: ioctl");
Expand Down

0 comments on commit 105c294

Please sign in to comment.