-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
37 lines (29 loc) · 819 Bytes
/
Makefile
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
28
29
30
31
32
33
34
35
36
37
.PHONY: help reload show uninstall install evtest scan
DEVICE := $(shell find /dev/input/by-id -name 'usb-*NORWII*-kbd')
help:
# usage: [sudo] make TARGET
# targets:
#
# reload # rebuilds and reloads the udev hwdb
# show # show installed files
# install # install local hwdb files in system
# uninstall # uninstall the hwdb files from system
# evtest # run evtest to watch the DEVICE
# scan # run evtest adn grep the scan codes
#
# DEVICE = $(DEVICE)
reload:
systemd-hwdb update
udevadm trigger
show:
ls /etc/udev/hwdb.d
cat /etc/udev/hwdb.d/90-norwii.hwdb
uninstall:
rm -f /etc/udev/hwdb.d/90-norwii.hwdb
install:
cp 90-norwii.hwdb /etc/udev/hwdb.d
evtest:
evtest $(DEVICE)
scan:
# scanning for hex values...
evtest $(DEVICE) | grep -io 'SCAN.*value.*'