On an embedded system (running Raspbian Stretch without X) I have a C++ application that sometimes "grabs" the raw keyboard inputs from /dev/input/event*.

When this happens (I set a flag in my code, so I know when) I want to disable the current virtual terminal (tty). This is to avoid to send commands to the o.s. when the user types.

Please note I don't want to disable the tty entirely! I just want to unbind the keyboard input from it.

  • 2
    Dealt with at unix.stackexchange.com/questions/173712 .
    – JdeBP
    Oct 4, 2017 at 8:46
  • Thanks, in the link is explicitly written that the best way is to use ioctl, setting the flag KDSKBMUTE. I'm not able to find which header define that and which fd I should use (i.e. to find the current tty).
    – Mark
    Oct 4, 2017 at 8:55


You must log in to answer this question.

Browse other questions tagged .