mmoller2k / pikeyd Goto Github PK
View Code? Open in Web Editor NEWUniversal Raspberry Pi GPIO keyboard daemon
Universal Raspberry Pi GPIO keyboard daemon
I've been attempting to use pikeyd with my RPi3 and have been unable to figure out how to prevent the inputs from repeating. I'm using gpio pins 17 and 18 with pin 6 of the pi as ground. The issue is that Pikeyd is outputting endless keypresses even if the button is only pressed once regardless of if I use a rotary switch, a button or just directly closing the circuit. The keypresses only stop after receiving an input from a keyboard. This has happened with every pin I have attempted to use and I am sure that the pins aren't to blame as they function correctly through the RPi GPIO module in python. I believe this could be an issue in my config file not debouncing the pins or something similar but I am unsure as to how I would add a debouncing function to the file (attached).
pikeyd.txt
Any help would be greatly appreciated.
I'm wondering if its possible to have pikey emulate key presses like alt+tab and similar. I am looking to configure several key combos like that. alt+tab ctrl+tab alt+leftarrow and such. I see it will do more than 1 key per button but is says it does them in order and not at the same time. Need the ability to use buttons to switch between open windows and different browser tabs in a wall mounted display. Thanks for any assistance on this.
On the latest version of rasbien I've tried make and make install and it doesn't work what shall I do?
Hi, I am using Pikeyd which uses an Arduino to translate a joystick movement into 4 output pins, setting them to High for up, down, left, right on the Raspberry Pi. In the below example, I have pin 13 connected to GPIO 22, which in Pikeyd will simulate the UP key. When I send pin 13 high, Pikeyd executes the KEY_UP, but when I set pin 13 low, Piked continues to have the KEY_UP executed. Basiclly it Pikeyd never tells uinput to go low.
Any ideas on how to resolve this?
Pikeyd doesn't work anymore on my RPi3 (worked fine on my RPi1). It seems, that people having a RPi2 have the same problem.
Any ideas, workarounds, alternatives, patches?
Regards, Thorsten
Can enyone help?
login as: osmc
[email protected]'s password:
Linux osmc 4.14.78-4-osmc #1 SMP PREEMPT Wed Dec 12 17:58:11 UTC 2018 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Jul 12 13:51:50 2019 from 192.168.79.112
osmc@osmc:$ git clone git://github.com/mmoller2k/pikeyd$ make -C pikeyd
Cloning into 'pikeyd'...
remote: Enumerating objects: 161, done.
remote: Total 161 (delta 0), reused 0 (delta 0), pack-reused 161
Receiving objects: 100% (161/161), 129.90 KiB | 0 bytes/s, done.
Resolving deltas: 100% (102/102), done.
osmc@osmc:
make: Entering directory '/home/osmc/pikeyd'
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c config.c -o config.o
config.c: In function 'handle_iic_event':
config.c:509:2: warning: implicit declaration of function 'sendKey' [-Wimplicit-function-declaration]
sendKey(k, x); /* switch is active low */
^~~~~~~
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c pikeyd.c -o pikeyd.o
pikeyd.c: In function 'main':
pikeyd.c:40:9: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
if(!strcmp(argv[i], "-d")){
^~~~~~
pikeyd.c:45:7: warning: implicit declaration of function 'daemonKill' [-Wimplicit-function-declaration]
daemonKill("/tmp/pikeyd.pid");
^~~~~~~~~~
pikeyd.c:62:5: warning: implicit declaration of function 'daemonize' [-Wimplicit-function-declaration]
daemonize("/tmp", "/tmp/pikeyd.pid");
^~~~~~~~~
pikeyd.c:66:3: warning: implicit declaration of function 'init_config' [-Wimplicit-function-declaration]
init_config();
^~~~~~~~~~~
pikeyd.c:74:6: warning: implicit declaration of function 'init_uinput' [-Wimplicit-function-declaration]
if(init_uinput() == 0){
^~~~~~~~~~~
pikeyd.c:75:5: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]
sleep(1);
^~~~~
pikeyd.c:85:2: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
usleep(4000);
^~~~~~
pikeyd.c:91:5: warning: implicit declaration of function 'close_uinput' [-Wimplicit-function-declaration]
close_uinput();
^~~~~~~~~~~~
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c daemon.c -o daemon.o
daemon.c: In function 'daemonize':
daemon.c:138:3: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]
umask(027);
^~~~~
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c keydefs.c -o keydefs.o
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c joy_RPi.c -o joy_RPi.o
joy_RPi.c: In function 'joy_RPi_init':
joy_RPi.c:153:7: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]
close(GpioFile);
^~~~~
joy_RPi.c: In function 'joy_handle_repeat':
joy_RPi.c:269:3: warning: implicit declaration of function 'get_last_key' [-Wimplicit-function-declaration]
get_last_key(&ks);
^~~~~~~~~~~~
joy_RPi.c:282:7: warning: implicit declaration of function 'sendKey' [-Wimplicit-function-declaration]
sendKey(ks.key, mxkey.value[idx]);
^~~~~~~
joy_RPi.c: In function 'joy_handle_event':
joy_RPi.c:300:2: warning: implicit declaration of function 'send_gpio_keys' [-Wimplicit-function-declaration]
send_gpio_keys(gpio_pin(Index), joy_data[Joystick].buttons[Index]);
^~~~~~~~~~~~~~
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c iic.c -o iic.o
iic.c: In function 'connect_iic':
iic.c:51:8: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]
if ( ioctl(fd, I2C_SLAVE, devAddr) < 0 ){
^~~~~
iic.c: In function 'poll_iic':
iic.c:63:3: warning: implicit declaration of function 'get_xio_parm' [-Wimplicit-function-declaration]
get_xio_parm(xio, &type, &chip_addr, ®no);
^~~~~~~~~~~~
iic.c:66:3: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
write(fd, buffer, 1);
^~~~~
iic.c:67:3: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
read(fd, buffer, 1);
^~~~
iic.c:69:3: warning: implicit declaration of function 'handle_iic_event' [-Wimplicit-function-declaration]
handle_iic_event(xio, buffer[0]);
^~~~~~~~~~~~~~~~
iic.c: In function 'close_iic':
iic.c:117:5: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]
close(fd);
^~~~~
arm-linux-gnueabihf-gcc -O2 -Wstrict-prototypes -Wmissing-prototypes -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -c uinput.c -o uinput.o
uinput.c: In function 'test_uinput':
uinput.c:103:9: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]
srand(time(NULL));
^~~~
arm-linux-gnueabihf-gcc -s config.o pikeyd.o daemon.o keydefs.o joy_RPi.o iic.o uinput.o -o pikeyd -L/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/lib -L/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/lib -L/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/lib/gcc/arm-linux-gnueabihf/4.7.2 -L/home/osmc/RPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/libexec/gcc/arm-linux-gnueabihf/4.7.2
make: Leaving directory '/home/osmc/pikeyd'
osmc@osmc:~$
hello,
I checked the joystick code, it does not seem to do anything related to joystick? I mean analog potentiometer reading through I2C ADC chip or anything
I really cant make it work on a RPI zero; so far I guessed I had to put the pikeyd.conf file in /etc, it starts, reading the config file
but no character appear in the console when I tie a gpio pin to gnd or 3.3v (with resistors like on the wiring diagram)
I checked my gpios with gpio utility, they seem to work fine though
is this project still maintained ?
regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.