Log In  

Got a https://www.sparkfun.com/products/16301 phat for raspberry pi.
Running pico8 on it is fine.

I want to use some custom gameinputs (joystick and button a,b on the phat) using uinput from linux.
Using a controller.c for reading i2c packages and generating uinput events KEY_C,X,LEFT,RIGHT,UP,DOWN.

<b>Got a problem with KEY_LEFT and KEY_RIGHT:

  • problem is that in the linux command line KEY_LEFT works fine.
  • If i start pico8 (console or splore) the KEY_LEFT doesn't work.

Any ideas?

P#78828 2020-07-03 07:00 ( Edited 2020-07-03 07:00)

it works now with a sleep during keypressed (50ms)

24 void pressKey(int fd, char key)
25 {
26 emit(fd, EV_KEY, key, 1);
27 emit(fd, EV_SYN, SYN_REPORT, 0);
28 usleep(50'000);
29 emit(fd, EV_KEY, key, 0);
30 emit(fd, EV_SYN, SYN_REPORT, 0);
31 }

P#78832 2020-07-03 09:53

[Please log in to post a comment]