v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-28 05:20:12 -07:00

refactor: space to Space

This commit is contained in:
eeeXun 2023-06-24 17:31:02 +08:00
parent 7c3dc3f3ca
commit 72de472090
3 changed files with 6 additions and 6 deletions

View File

@ -176,9 +176,9 @@ You can overwrite the following key
- `toggle_transparent`: Toggle transparent.
- `toggle_below`: Toggle Definition/Example & Part of speech.
For key to combine with `Ctrl`, the value can be `"C-space"`, `"C-\\"`, `"C-]"`, `"C-^"`, `"C-_"` or `"C-a"` to `"C-z"`.
For key to combine with `Ctrl`, the value can be `"C-Space"`, `"C-\\"`, `"C-]"`, `"C-^"`, `"C-_"` or `"C-a"` to `"C-z"`.
For key to combine with `Alt`, the value can be `"A-space"` or `"A-"` + the character you want.
For key to combine with `Alt`, the value can be `"A-Space"` or `"A-"` + the character you want.
Or you can use function key, the value can be `"F1"` to `"F64"`.

View File

@ -1,8 +1,8 @@
# This file should be located at $XDG_CONFIG_HOME/gtt/keymap.yaml or $HOME/.config/gtt/keymap.yaml.
# For key to combine with Ctrl, the value can be "C-space", "C-\\", "C-]", "C-^", "C-_" or "C-a" to "C-z".
# For key to combine with Ctrl, the value can be "C-Space", "C-\\", "C-]", "C-^", "C-_" or "C-a" to "C-z".
# For key to combine with Alt, the value can be "A-space" or "A-" + the character you want.
# For key to combine with Alt, the value can be "A-Space" or "A-" + the character you want.
# Or you can use function key, the value can be "F1" to "F64".

4
key.go
View File

@ -92,7 +92,7 @@ var keyNames = map[tcell.Key]string{
tcell.KeyCtrlX: "C-x",
tcell.KeyCtrlY: "C-y",
tcell.KeyCtrlZ: "C-z",
tcell.KeyCtrlSpace: "C-space",
tcell.KeyCtrlSpace: "C-Space",
tcell.KeyCtrlUnderscore: "C-_",
tcell.KeyCtrlRightSq: "C-]",
tcell.KeyCtrlBackslash: "C-\\",
@ -107,7 +107,7 @@ func getKeyName(event *tcell.EventKey) string {
if event.Modifiers() == tcell.ModAlt {
switch event.Rune() {
case ' ':
keyName = "A-space"
keyName = "A-Space"
default:
keyName = "A-" + string(event.Rune())
}