@JeffSchaller, thank you for the edits.
Based on @IporSircer's answer (thanks!), I was able to create the following script:
#!/bin/bash
device='/dev/input/by-id/usb-Targus_Laser_Presentation_Remote-if02-event-kbd'
event_blank='*code 48 (KEY_B), value 1*'
event_esc='*code 1 (KEY_ESC), value 1*'
event_f5='*code 63 (KEY_F5), value 1*'
event_prev='*code 104 (KEY_PAGEUP), value 1*'
event_next='*code 109 (KEY_PAGEDOWN), value 1*'
evtest "$device" | while read line; do
case $line in
($event_blank) echo "BLANK SCREEN" ;;
($event_f5) echo "F5" ;;
($event_esc) echo "ESCAPE" ;;
($event_prev) echo "PREVIOUS" ;;
($event_next) echo "NEXT" ;;
esac
done
Using evtest
I was able to find out the event number /dev/input/event18
for the device, but this number may vary depending on the devices on your system and in which order they were connected
Because of that I used udevadm info /dev/input/event18
to find out the device's unique id
S: input/by-id/usb-Targus_Laser_Presentation_Remote-if02-event-kbd
Finally, using evtest
again I was able to catch all events from device to use them on the case
statement.