如何在播放视频时锁定键盘和鼠标

如何在播放视频时锁定键盘和鼠标

我想设置我的 Ubuntu 12.04 笔记本电脑,这样我就可以在电脑无人看管时循环播放视频,同时不允许任何人在没有密码的情况下接管。我认为这可以采用两种方式之一,但这两种方式似乎都过于困难或不合时宜:

  1. 找到一个可以用密码锁定键盘和鼠标的视频播放器,或者

  2. 使用正常的 ubuntu 锁定和循环播放视频的屏幕保护程序。

不幸的是,我很难找到一种简单的方法来实现 (1),而且 Ubuntu 似乎甚至不再有屏幕保护程序,因此 (2) 也很困难。

有关如何实现此目的的最佳方法的任何建议都会有所帮助。

答案1

尝试

xtrlock 锁定 X 服务器,直到用户在键盘上输入密码。

   While  xtrlock  is  running, the mouse and keyboard are grabbed and the
   mouse cursor becomes a padlock.  Output displayed by  X  programs,  and
   windows  put  up  by new X clients, continue to be visible, and any new
   output is displayed normally.

   The mouse and keyboard are returned when the user types their password,
   followed  by Enter or Newline.  If an incorrect password is entered the
   bell is sounded.  Pressing Backspace or Delete erases one character  of
   a  password  partially  typed; pressing Escape or Clear clears anything
   that has been entered.

   If too many attempts are made in too short a  time  further  keystrokes
   generate bells and are otherwise ignored until a timeout has expired.

   The  X  server  screen saver continues to operate normally; if it comes
   into operation the display may  be  restored  by  the  usual  means  of
   touching a key (Shift, for example) or the mouse.

使用安装

sudo apt-get install xtrlock

打开终端运行xtrlock以锁定键盘和鼠标输入。

注意,输入您的活动用户密码来解锁,然后按回车键。

相关内容