I have a raspberry running on a screen and Chromium in kiosk mode.
It work greate and now I have even add 3 other tab of webpage that I like to Control with a tiny keyboard that have 6 button on.
When I press "1" it show a in the terminal, "2" show b ……..
I have think about use javascript and use DIV to change page but it feel this is more faster and it works

I also guess I can use only python because right now I use bash to read the input
(menu.sh)
Code: Select all
#!/bin/bash
while true; do
read -rsn1 input
if [ "$input" = "a" ]; then
python /home/pi/control/tab1.py
echo "Tab 1"
fi
if [ "$input" = "b" ]; then
python /home/pi/control/tab2.py
fi
if [ "$input" = "c" ]; then
python /home/pi/control/tab3.py
fi
if [ "$input" = "d" ]; then
python /home/pi/control/tab4.py
fi
if [ "$input" = "e" ]; then
python /home/pi/control/tab5.py
fi
done
and I use python to simulate the tab change
(tab1.py)
Code: Select all
from pynput.keyboard import Key, Controller
keyboard = Controller()
keyboard.press(Key.ctrl)
keyboard.press('1')
keyboard.release('1')
keyboard.release(Key.ctrl)
I know the bash code works because "Tab 1" show when I press button 1
I also know the python works when I run from a remote computer with python the script
But when I put the bash script so it autoload when the raspberry startup nothing happend when I press the button.
Have no idea why it does not work.