mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-31 23:10:30 -07:00
refactor: space to Space
This commit is contained in:
parent
7c3dc3f3ca
commit
72de472090
@ -176,9 +176,9 @@ You can overwrite the following key
|
|||||||
- `toggle_transparent`: Toggle transparent.
|
- `toggle_transparent`: Toggle transparent.
|
||||||
- `toggle_below`: Toggle Definition/Example & Part of speech.
|
- `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"`.
|
Or you can use function key, the value can be `"F1"` to `"F64"`.
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# This file should be located at $XDG_CONFIG_HOME/gtt/keymap.yaml or $HOME/.config/gtt/keymap.yaml.
|
# 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".
|
# Or you can use function key, the value can be "F1" to "F64".
|
||||||
|
|
||||||
|
4
key.go
4
key.go
@ -92,7 +92,7 @@ var keyNames = map[tcell.Key]string{
|
|||||||
tcell.KeyCtrlX: "C-x",
|
tcell.KeyCtrlX: "C-x",
|
||||||
tcell.KeyCtrlY: "C-y",
|
tcell.KeyCtrlY: "C-y",
|
||||||
tcell.KeyCtrlZ: "C-z",
|
tcell.KeyCtrlZ: "C-z",
|
||||||
tcell.KeyCtrlSpace: "C-space",
|
tcell.KeyCtrlSpace: "C-Space",
|
||||||
tcell.KeyCtrlUnderscore: "C-_",
|
tcell.KeyCtrlUnderscore: "C-_",
|
||||||
tcell.KeyCtrlRightSq: "C-]",
|
tcell.KeyCtrlRightSq: "C-]",
|
||||||
tcell.KeyCtrlBackslash: "C-\\",
|
tcell.KeyCtrlBackslash: "C-\\",
|
||||||
@ -107,7 +107,7 @@ func getKeyName(event *tcell.EventKey) string {
|
|||||||
if event.Modifiers() == tcell.ModAlt {
|
if event.Modifiers() == tcell.ModAlt {
|
||||||
switch event.Rune() {
|
switch event.Rune() {
|
||||||
case ' ':
|
case ' ':
|
||||||
keyName = "A-space"
|
keyName = "A-Space"
|
||||||
default:
|
default:
|
||||||
keyName = "A-" + string(event.Rune())
|
keyName = "A-" + string(event.Rune())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user