Is there any freeware tool or procedure that will lock the keyboard and mouse with a single click?
Or, if you're using Windows, you can easily set a password to your account, and lock the computer when leaving (Win+L). It will ask for your password to reactivate it, just like (i guess) the freeware mentioned by the previous commenters.
The simpler solutions are sometimes the best. If the above solutions do not suit you for whatever reason, maybe you should specify the exact circumstances in which the access to your computer needs to be restricted.
Hello, there was a similar question a few days ago. You can accomplish what you want with the following: ToddlerTrap