6

Following up with this other question, how can I temporarily disable the touchpad (both movements and buttons) as well as the keyboard in Linux Ubuntu Hardy? I mean, there is a menu for disabling the mouse (and there might be one for the keyboard), but I don't want to lock myself out. The best would be an option to decide which keys on the keyboard I want to be working (e.g. arrows to scroll the page I'm reading) and with a fast keys combination to lock/unlock (e.g. one not easily pushed by my toddler little hands: left-shift + ESC + right-shift + backspace + space)

Edit: I get the tumbleweed badge with this question, but it was seen and even starred? Does anybody have an answer? Let's try with a bounty....

5 Answers 5

5
+100

I found this for the keyboard, but cannot find anything for mouse :( - I will keep looking.

3
  • 3
    The original is here: sourceforge.net/projects/lk4b Thanks, I'll give it a try and vote you accordingly :-)
    – Davide
    Commented Nov 28, 2009 at 20:18
  • 3
    This is great! And the latest version from sourceforge does actually have support for mouse too! You win :-)
    – Davide
    Commented Dec 4, 2009 at 4:45
  • Just goes to show you there really is no end to the little gadgets people will dream up. Commented Dec 4, 2009 at 15:58
5

You could use a screen locking utility such as xlock or slock. slock is a nice simple one to use.

If you require that you can see the contents of the display, then try this command with xlock. This should keep the monitor up and lock the keyboard and mouse until you type in your password:

xlock -mode image -count 1 -bg black -fg black -geometry 0x0 -timeout 1

This wouldn't allow you to use the arrow keys, though.

EDIT:

Oddly enough, I went to google for your question and came up with a thread that I personally had posted to LinuxQuestions.org awhile ago with the EXACT same issue. You can try binding keys to acpid, but I'm not sure you can do that for basic keyboard commands...

http://www.linuxquestions.org/questions/linux-software-2/xlock-allow-certain-keys-450662/

3
  • 1
    how do you "lock the keyboard" if you're allowing the password to be typed?
    – warren
    Commented Dec 1, 2009 at 0:38
  • This sort of works, but it's not what I'm looking for. In fact, as soon as the keyboard or mouse is touched, the screen becomes black (whereas I'd like to continue seeing what I was looking at)
    – Davide
    Commented Dec 4, 2009 at 4:37
  • There is another idea...do not know if there is one for linux but worth investigating - a usb key with a transmitter, and you wear a 'necklace' that is the receiver. When you are outside of the range of line of sight, the computer automatically locks up, even if you remove the usb key from the computer, it will lock up also..have seen them for Windows alright...
    – t0mm13b
    Commented Dec 4, 2009 at 17:18
4

xtrlock is worth considering. It does not have the requested capability of selecting which keys on the keyboard you want to be working, but it does allow locking the keyboard in addition to the mouse.

https://ostechnix.com/lock-keyboard-mouse-not-screen-linux/

$> sudo apt install xtrlock
$> xtrlock
1
  • 1
    Thanks. This might be useful to others. As you can guess from the date of my post, my "babies" are now teenagers....
    – Davide
    Commented Sep 21, 2020 at 12:44
1

There is two things that comes to my mind on this...if you are talking about in X (KDE/Gnome), then you have to get out of it (Ctrl+Alt+Backspace) unless the system is set up to use kdm or gdm (the login screen for KDE/Gnome respectively). There is a little command line utility that actually locks up the keyboard called kbdlock here, this locks up the keyboard and you have to enter your login password to unlock it. As for temporarily disabling the touchpad, since that is a generic mouse driver with synaptics module loaded, create a simple shell script to load and unload the module in question, armed with kbdlock you have the combination sorted. What do you think?

Hope this helps, Best regards, Tom.

1
  • Looks pretty similar to lk2b with adding a window to the display. Commented Dec 4, 2009 at 15:57
0

I know you're using Linux, so this solution is not of much help. But, during the explosion of LOLcat humor, somethings proved more utilitarian. I would guess that baby-like typing would be similar to cat-like typing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .