Merge pull request #8 from Donkey-Hao/Donkey-Hao-patch-5

translated
This commit is contained in:
Donkey 2022-07-30 13:42:07 +08:00 committed by GitHub
commit 8db20c0529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 151 additions and 151 deletions

View File

@ -1,151 +0,0 @@
[#]: subject: "Use secret keyboard keys on Linux"
[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "Donkey"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use secret keyboard keys on Linux
======
With a compose key, you're not limited to what's on your keyboard. Download the cheat sheet.
![Linux keys on the keyboard for a desktop computer][1]
A typical computer keyboard has only about 100 keys on it.
Most keys double up on characters, also called glyphs, thanks to the Shift key. Glyphs are frequently used to type letters with accents and umlauts, to produce characters used in mathematic or monetary expressions, or just to add fun emojis. In some regions there are even three glyphs available on select keys.
Regardless of your region, however, some glyphs don't make it onto your keyboard. Fortunately, Linux provides access to these through a compose key.
There's no compose key on your keyboard, at least not by default, but you can designate a key you're not otherwise using as your compose key. I use the Alt key to the right of the spacebar on my desktop keyboard and the Menu key on my laptop.
**[[ Download the cheat sheet: Linux compose key ]][2]**
### Setting a Compose key in GNOME
![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3]
Image by:
(Seth Kenlon, CC BY-SA 4.0)
On the GNOME desktop, install the Tweaks application from your software repository. You can also install it from a terminal (use `apt` for Debian-based distributions, `dnf` for Fedora and similar):
```
$ sudo dnf install gnome-tweaks
```
After you launch Tweaks:
1. Click on the Keyboard & Mouse category in the left column.
2. Locate the Compose key setting and choose a key to designate.
3. Close Tweaks.
### Setting a Compose key in KDE Plasma Desktop
![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4]
Image by:
(Seth Kenlon, CC BY-SA 4.0)
On the KDE Plasma Desktop, open System Settings and navigate to the Input Devices control panel. Then:
1. In the Input Devices panel, click the Advanced tab.
2. Find the Compose key list item and choose a key to designate.
3. Click the Apply button in the bottom right corner of the window and then close System Settings.
### Using compose sequences
To enter a hidden character, press the compose key and then release it. You're now in compose mode. While in compose mode, you can press and release one key and then another to combine characters.
For instance:
1. Press the compose key and release it. You are now in compose mode.
2. Press an apostrophe (') and then release it.
3. Press the letter E and then release it. This is a valid combination, so you are now out of compose mode.
You've just typed the letter É!
Some compose sequences are a combination of just two keys, while others require three keys, and at least one special glyph uses a series of four key presses.
### The secret glyphs
It's a small world, so there's a good chance you've got friends whose names use glyphs that aren't native to your keyboard. You can now stop skipping over diacritics and type names using the appropriate modifiers.
Here's a sample list of compose sequences for common diacritics:
* ' + <letter> = á é í ó ú ć ń ý j́́ ẃ ź
* ` + <letter> = à è ì ò ù ǹ ỳ ẁ
* ~ + <letter> = ã ẽ ĩ õ ũ ñ ỹ
* ^ + <letter> = â ê î ô û ĉ ŷ ĵ ŵ ẑ
* u + <letter> = ă ĕ ĭ ŏ ŭ
* c + c = č
* - + <letter> = ā ē ī ō ū đ
* , + <letter> = ą ę į ǫ ų ç ḑ ţ
That's not a complete list, but it covers a lot of the common ones.
#### Currency
International banking gets a little easier thanks to the compose key, too:
* - + Y = ¥
* - + L = £
* = + E = €
* = + L = ₤
* = + N = ₦
* = + R = ₹
* = + W = ₩
* / + m = ₥
* R + s = ₨
* C + r = ₢
* F + r = ₣
Once again, that's not a complete list, but it's a good start.
#### Fun glyphs
Diacritics and currency are useful, but the compose key can be used just for fun, too.
* < + 3 = ♥
* < + > = ⋄
* # + q = ♩
* : + ) = ☺
* : + ( = ☹
* p + o + o = 💩
#### Live long and prosper
My favorite "secret" glyph in Linux is the traditional Vulcan salutation, "Live long and prosper."
* L + L + A + P = 🖖
### Finding all the glyphs
There are many more glyphs available through the compose key, and you can have fun discovering new ones by pressing random compose sequences. A more methodical method for finding glyphs is to refer to the `Compose` file, located in `/usr/share/X11/locale/en_US.UTF-8` (adjust the exact path depending on the locale your keyboard uses).
That file can admittedly be overwhelming, as it consists of over 6,000 lines of compose sequences, many of which are complex combinations of ASCII and Unicode. For a quick and easy reference of common and foundational sequences, you can [download our compose key cheat sheet][5]. It provides sequences covering mathematics, typography, music, arrows, diacritics, currency, and more.
Now that you're in on the secret, your range of expression just got a whole lot bigger.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[Donkey](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png
[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet
[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg
[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg
[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet

View File

@ -0,0 +1,151 @@
[#]: subject: "Use secret keyboard keys on Linux"
[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "Donkey"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 Linux 中使用隐藏键
======
使用组合键,你不会被键盘所限制住。请下载速查表。
![Linux keys on the keyboard for a desktop computer][1]
典型的键盘只有约 100 个键位。
由于 Shift 键,许多键得以有两个字符,也称之为字形。字形常用于键入带有重音和变音符号的字母,生成数学公式或者货币中的符号,或者添加有趣的表情符号。在一些地区,选择键甚至有三个字形。
然而不论你身处何处一些字形不会出现在你的键盘上。幸运的是Linux 提供了使用组合键来获取这些字形。
默认情况下你的键盘上没有组合键,但是你可以设定一个你不用的键作为组合键。我在电脑上使用空格键旁边的 Alt 键,而在平板上使用菜单键,来作为组合键。
**[请下载 Linux 组合键速查表][2]**
### 在 GNOME 中设置组合键
![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3]
图片源自:
(Seth Kenlon, CC BY-SA 4.0)
在 GNOME 桌面,从软件库中安装 Tweas 应用。你也可以从终端安装(基于 Debian 发行版用 `apt` 命令, `dnf` 用于 Fedora
```
$ sudo dnf install gnome-tweaks
```
启动 Tweaks 后:
1. 单击左侧栏中的键盘和鼠标类别
2. 找到组合键设置并指定一个键
3. 关闭 Tweaks
### 在 KDE Plasma 桌面设置组合键
![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4]
图片源自:
(Seth Kenlon, CC BY-SA 4.0)
在 KDE Plasma 桌面上,打开系统设置,找到输入设备控制界面。然后:
1. 在输入设备界面,点击 “高级”
2. 找到组合键列表项并指定一个键
3. 点击右下角 “应用” 按钮,然后关闭系统设置
### 使用组合序列
为了输入隐藏字符,需要按下组合键后松开。这样就可以进入组合模式。处于组合模式,你按下然后松开键,然后再按下一个键来组合字符。
例如:
1. 按下组合键并释放,你会进入组合模式
2. 按下单引号 ( ' ) 并松开
3. 按下 E 并松开,这是一个有效的组合,因为你现在退出了组合模式
你输入了一个字符:É!
一些组合序列需要两个键的组合,然而还有一些需要三个键,并且至少一个特殊字符要按下四次键。
### 变音字符
这是一个很小众的世界,所以你的朋友的名字很有可能使用的字形不是你的键盘原生的。你现在可以跳过变音符号并使用适当的修饰符输入名字。
以下是常见变音符号的组合序列示例:
* ' + <字母> = á é í ó ú ć ń ý j́́ ẃ ź
* ` + <字母> = à è ì ò ù ǹ ỳ ẁ
* ~ + <字母> = ã ẽ ĩ õ ũ ñ ỹ
* ^ + <字母> = â ê î ô û ĉ ŷ ĵ ŵ ẑ
* u + <字母> = ă ĕ ĭ ŏ ŭ
* c + c = č
* \- \+ <字母> = ā ē ī ō ū đ
* , + <字母> = ą ę į ǫ ų ç ḑ ţ
这里仅仅罗列了常见的几个,并不是所有的组合。
#### 货币符号
得益于组合键,国际银行业务也变得容易:
* \- + Y = ¥
* \- + L = £
* = + E = €
* = + L = ₤
* = + N = ₦
* = + R = ₹
* = + W = ₩
* / + m = ₥
* R + s = ₨
* C + r = ₢
* F + r = ₣
重申,这不是完整的列表,但是一个好的开始。
#### 有趣的字形
变音符号和货币符号具有实用性,但是组合键也可以用来娱乐:
* < + 3 = ♥
* < + > = ⋄
* \# + q = ♩
* : + ) = ☺
* : + ( = ☹
* p + o + o = 💩
#### 长寿和繁荣
在 Linux 中我最喜欢的“秘密”字形是传统的 Vulcan 称呼,“长寿和繁荣”。
* L + L + A + P = 🖖
### 找到所有的字形
通过组合键可以使用更多字形,你可以通过按随机组合序列来发现新的字形。查找字形的一种更有条理的方法是参考位于 `/usr/share/X11/locale/en_US.UTF-8` 中的 `Compose` 文件(需要根据你键盘使用的语言环境调整绝对路径)。
该文件令人崩溃,因为它包含超过 6000 行的组合序列,其中许多是 ASCII 和 Unicode 的复杂组合。要快速轻松地参考常见和基础序列,你可以[下载我们的组合键速查表][5]。它提供涵盖数学、排版、音乐、箭头、变音符号、货币等的序列。
现在你知道了这个秘密,你可以表达更多内容了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[Donkey](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png
[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet
[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg
[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg
[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet