Documentsdisable-mouse-and-keyboard-inputs-for-player-from-server

Disable mouse and keyboard inputs for player from server

One udev rule and a reboot switches off USB keyboard and mouse input on a Pi player.

You can disable the USB keyboard for a player by running a command against the player from the Terminal in the screen controls (see Screens) or by connecting over SSH. The command writes a udev rule, and after a reboot both the keyboard and the mouse stop working. The rule targets the usbhid driver, so it affects USB HID devices in general, not only keyboards.

Disable input

  1. Create the rule file.
    echo 'SUBSYSTEMS<mark>"usb", DRIVERS</mark>"usbhid", ACTION=="add", ATTR{authorized}="0"' | sudo tee /etc/udev/rules.d/97-disablekb.rules
    
  2. Reboot the player.
    sudo reboot
    

Enable input again

  1. Remove the rule file from the Terminal or over SSH.
    sudo rm /etc/udev/rules.d/97-disablekb.rules
    
  2. Reboot the player.
    sudo reboot
    

Once input is disabled you cannot use a keyboard or mouse on the player, so make sure you can still reach it from the server before you do this.