caps lock_在Ubuntu中启用Caps Lock或Num Lock时如何获取通知

caps lock

caps lock

00_lead_image_lock_keys_indicator

If you’ve accidentally turned on Caps Lock too many times–we’ve all been there–here is a solution. You can add an indicator to the top panel that shows the status of the Caps Lock, Num Lock, and Scroll Lock keys, that notifys you when one of them is pressed.

如果您不小心将Caps Lock打开了太多次(我们都去过那里),这里有一个解决方案。 您可以在顶部面板上添加一个指示器,以显示Caps Lock,Num Lock和Scroll Lock键的状态,当其中之一被按下时通知您。

Sure, you could disable or reassign the Caps Lock key, but if you use it occasionally, this is the next best thing. You only need to install a small app called Indicator Keylock.

当然,您可以禁用或重新指定Caps Lock键 ,但是如果偶尔使用它,则这是次佳的选择。 您只需要安装一个名为Indicator Keylock的小应用程序。

To begin, we’re going to add the repository that contains the Indicator Keylock program. To do that, press Ctrl+Alt+T to open a Terminal window. Then, type the following command at the prompt and press Enter:

首先,我们将添加包含Indicator Keylock程序的存储库。 为此,请按Ctrl + Alt + T打开“终端”窗口。 然后,在提示符下键入以下命令,然后按Enter:

sudo add-apt-repository ppa:tsbarnes/indicator-keylock

Type your account password when prompted and press Enter again.

在出现提示时输入您的帐户密码,然后再次按Enter。

01_adding_repository

Press Enter when prompted to continue adding the repository.

当提示您继续添加存储库时,按Enter键。

02_press_enter_to_continue_adding_repository

Once the repository has been added, type the following command and press Enter to make sure the indicator-keylock package is up to date, as well as all other packages.

添加存储库后,键入以下命令,然后按Enter以确保indicator-keylock软件包以及所有其他软件包都是最新的。

sudo apt update
03_updating_repository

Now, we’ll install the indicator-keylock program. Type the following command at the prompt and press Enter.

现在,我们将安装指标键锁程序。 在提示符下键入以下命令,然后按Enter。

sudo apt install indicator-keylock

Enter your password, if prompted.

如果有提示,请输入密码。

04_installing_indicator_keylock

When asked if you want to continue, type y and press Enter.

当询问您是否要继续时,键入y并按Enter。

05_do_you_want_to_continue

When the installation is finished, either type exit at the prompt and press Enter, or click the “X” button in the upper-left corner of the Terminal window to close it.

安装完成后,在提示符下键入exit并按Enter,或单击“终端”窗口左上角的“ X”按钮以将其关闭。

06_closing_terminal

You must either log out and back in or reboot for the Indicator Keylock program to be added to the top panel. You’ll notice, at first, that you don’t see any indicator on the panel, even when you turn Num Lock on and off. But, you will see a notification box display below the top panel on the right side of the screen when you toggle Num Lock on or off.

您必须注销然后重新登录或重新引导,才能将指标键盘锁程序添加到顶部面板。 首先,您会注意到,即使打开和关闭Num Lock,面板上也看不到任何指示器。 但是,当您打开或关闭Num Lock时,您将在屏幕右侧顶部面板下方看到一个通知框。

07_num_lock_on_notification

However, when you turn Caps Lock on, not only do you see a notification, but you also see a red icon with the letter “A” on the top panel. The icon is red when Caps Lock is on.

但是,当您打开Caps Lock时,不仅会看到通知,而且还会在顶部面板上看到带有字母“ A”的红色图标。 打开Caps Lock时,该图标为红色。

08_caps_lock_on_notification

Only one icon displays on the panel, but you can choose which icon you want to display. Click on the A icon on the panel and select an icon from the drop-down menu.

面板上仅显示一个图标,但是您可以选择要显示的图标。 单击面板上的A图标,然后从下拉菜单中选择一个图标。

09_selecting_icon_to_show_on_panel

The menu indicates which Lock keys are on by turning the icons on the menu red for the Lock keys that are currently on. For example, the image below indicates that the Num Lock key is the only Lock key that is currently on. Notice, however, that the icon on the panel is not red, even though the Num Lock key is on. There is a setting in the Preferences that allows you to specify which Lock key will turn the icon on the panel red and, by default, it’s initially set to the Caps Lock key. To change this setting, select “Preferences” from the drop-down menu.

菜单通过将菜单上的图标变为当前打开的Lock键的红色来指示打开了哪些Lock键。 例如,下面的图像指示Num Lock键是当前打开的唯一Lock键。 但是请注意,即使Num Lock键已打开,面板上的图标也不是红色的。 首选项中有一个设置,可让您指定哪个锁定键会将面板上的图标变成红色,并且默认情况下,它最初设置为Caps Lock键。 要更改此设置,请从下拉菜单中选择“首选项”。

10_selecting_preferences

Remember that, initially, there was no icon on the panel? The only way to get an icon on the panel was to turn on Caps Lock. Then, you can click the icon and change it or open the Preferences. You can choose to always display an icon on the panel whether any of the Lock keys are on or not. To do this, check the “Show indicator while lock key is inactive” box.

还记得最初在面板上没有图标吗? 在面板上获取图标的唯一方法是打开Caps Lock。 然后,您可以单击图标进行更改或打开“首选项”。 无论是否打开任何锁定键,您都可以选择始终在面板上显示图标。 为此,请选中“锁定键未激活时显示指示器”框。

The Caps Lock, Num Lock, and Scroll Lock options on the Preferences dialog control which key being on will turn the indicator icon on the panel red. For example, I want the icon on the panel to turn red when the Num Lock key is on because my keyboard does not have an indicator for that key.

首选项对话框中的Caps Lock,Num Lock和Scroll Lock选项控制哪个键处于打开状态将使面板上的指示器图标变为红色。 例如,我希望在Num Lock键启用时面板上的图标变为红色,因为我的键盘上没有该键的指示器。

If you don’t want an indicator to show on the panel at all, even if any of the Lock keys are on, uncheck the “Use an application indicator” box.

如果您根本不想在面板上显示任何指示器,即使任何一个锁定键都已打开,也请取消选中“使用应用程序指示器”框。

11_preferences_dialog

Click “Close” to save your settings and close the Preferences dialog box.

单击“关闭”以保存您的设置并关闭“首选项”对话框。

I’ve selected Num Lock both on the dropdown list and on the Preferences dialog box. So, Indicator Keylock is now set up to show the Num Lock icon on the panel and for that icon to turn red only when the Num Lock key is on. If the Caps Lock or Scroll Lock keys are on, they will turn red on the drop-down menu, but won’t turn the icon on the panel red.

我在下拉列表和“首选项”对话框上都选择了Num Lock。 因此,现在设置了指示器键锁,以在面板上显示Num Lock图标,并且仅当Num Lock键打开时,该图标才会变为红色。 如果Caps Lock或Scroll Lock键处于打开状态,则它们在下拉菜单上将变为红色,但不会将面板上的图标变为红色。

12_selecting_which_lock_key_causes_red

If you unchecked the “Use an application indicator” box on the Preferences dialog box, you may be wondering how to get the indicator back, considering there is no icon at all on the panel to click on so you can open the Preferences dialog box. No worries. You can still open the Preferences dialog box. Simply click the Dash button on the Unity launcher, or you can press the Super key on your keyboard (which is usually the Windows key on typical keyboards).

如果未选中“首选项”对话框上的“使用应用程序指示器”框,则可能会想知道如何找回指示器,因为面板上根本没有要单击的图标,因此可以打开“首选项”对话框。 别担心。 您仍然可以打开“首选项”对话框。 只需单击Unity启动器上的Dash按钮,或者您可以按键盘上的Super键(通常是典型键盘上的Windows键)。

13_opening_dash

Start typing indicator in the search box at the top of the screen, until you see the Indicator-LockKeys icon display. Click on that icon to open the Preferences dialog box. Then, you can check the “Use an application indicator” box again to have the indicator display when you turn on Caps Lock, as well as change the other settings on the Preferences dialog box.

在屏幕顶部的搜索框中开始输入indicator ,直到看到指示符-LockKeys图标显示。 单击该图标以打开“首选项”对话框。 然后,您可以再次选中“使用应用程序指示器”框,以在打开Caps Lock以及更改“首选项”对话框上的其他设置时显示指示器。

14_opening_indicator_keys_preferences

When you change any of the settings in Indicator Keylock, they might not take effect immediately. You might have to toggle the affected Lock key a couple of times before the setting is applied.

当您更改指示器键锁中的任何设置时,它们可能不会立即生效。 在应用该设置之前,您可能必须多次切换受影响的锁定键。



Windows users can take advantage of similar tricks, too. In Windows, you can have the system play a sound or you can get a taskbar notification when any of these keys are pressed.

Windows用户也可以利用类似的技巧。 在Windows中,您可以让系统播放声音 ,也可以在按下其中任何一个键时获得任务栏通知

翻译自: https://www.howtogeek.com/274587/how-to-get-a-notification-when-caps-lock-or-num-lock-is-enabled-in-ubuntu/

caps lock

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值