#!/bin/bash INPUT_HEADER="/usr/include/linux/input.h" OUTPUT_ENUM="linux-input-enum.h" OUTPUT_MAP="linux-input-keycodes.h" SKIP="KEY_MIN_INTERESTING KEY_MAX KEY_CNT" if [ ! -e "$INPUT_HEADER" ]; then echo "Can't find input header: $INPUT_HEADER" >&2 exit 1 fi cat > "$OUTPUT_ENUM" < "$OUTPUT_MAP" <> "$OUTPUT_ENUM" echo " { \"$NAME\", $NAME, $ALIAS, NULL }," >> "$OUTPUT_MAP" done cat >> "$OUTPUT_ENUM" << EOF }; #endif EOF cat >> "$OUTPUT_MAP" << EOF { NULL, 0, false, NULL } }; #endif EOF exit 0