How can I childproof the keyboard?

How could I make the keyboard/touchpad safe for my toddler to use on my laptop? (e.g. allow numbers and letters but disable F1, Esc, touchpad, click events, etc). I have read How to disable keys from the keyboard?, but that does not discuss everything. I am wondering if there is a pre-existing solution so that I do not need to work through all of those details myself.

I would like to be able to press a "secret set of keys" and then switch between "safe" keyboard mode and "normal" keyboard mode. I would like to do this so that I can use my keyboard, then my child may type on the keyboard, and then I can continue using the keyboard.

I am using Ubuntu 12.04.3 LTS

$ uname --kernel-release --kernel-version --machine
3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013 x86_64

Solution 1:

Afraid there isn't a pre-existing solution.

For the "secret key combination", see [gnome icon] → Control Center → Key Combinations. Really, anything with a control-key+letter will probably be safe from a toddler.

For disabling keys, xmodmap is probably your best bet. Here's how to set F1..F3 to print period or the corresponding number depending on the "shift" state...

xmodmap <<EOX -
keycode 67 = period 1
keycode 68 = period 2
keycode 69 = period 3
EOX

(that way they do "something", just nothing funny).

And this is fine for "small child comes along, wants to play with keyboard". As they get older, they'll need their own account.