summaryrefslogtreecommitdiffstats
path: root/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh
blob: d0e0b0b6b8b60fa9c3e258cbc330bad1cac51f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

while sleep 1 ;do evtest /dev/input/by-id/usb-wch.cn_CH57x-event-kbd ;done | while read line; do
    unset key target_container
    [[ "$line" =~ \((KEY_.)\),\ value\ 1 ]] && key="${BASH_REMATCH[1]}"
    case "$key" in
        KEY_G)
            cmcontrol --change-active-guest-name=agl-flutter-ivi-demo
            cmcontrol --shutdown-guest-role=ivi
            ;;
        KEY_D)
            cmcontrol --change-active-guest-name=agl-qt-ivi-demo
            cmcontrol --shutdown-guest-role=ivi
            ;;
        KEY_A)
            cmcontrol --change-active-guest-name=agl-momi-ivi-demo
            cmcontrol --shutdown-guest-role=ivi
            ;;
        KEY_H)
            cmcontrol --change-active-guest-name=agl-html5-ivi-demo
            cmcontrol --shutdown-guest-role=ivi
            ;;
        KEY_C)
            cmcontrol --force-reboot-guest-role=ivi
            ;;
    esac
done