Conversation
src/key.rs
Outdated
| #[serde(default)] | ||
| pub struct KeyMap { | ||
| #[serde(deserialize_with = "deseralize_key")] | ||
| pub remove_previous_word: Option<Key>, |
There was a problem hiding this comment.
I think these should be named delete_word and delete_char. Ctrl-Backspace usually removes the current word.
There was a problem hiding this comment.
Usually Ctrl+Backspace, removes the word (part of the word if the cursor is between the word) before the cursor, that's why i chose it to name it remove_previous_word. In my opinion delete_word would somewhat be misleading, because delete_word indicates the its deleting the whole word, but instead it removes the word before the cursor.
| } | ||
|
|
||
| fn get_key_modifier_from_string(string: &str) -> KeyModifiers { | ||
| match string { |
There was a problem hiding this comment.
It would probably be good to support non-abbreviated modifiers for each of these also. For example, "Ctrl", "Alt", etc. Some people also call the Meta key "Super" or "Win".
There was a problem hiding this comment.
I did not quite understand this?
Should I allow "Ctrl-Backspace" as an option for config?
And Meta and Super are seperate modifiers, so i dont quite get what you mean.
| "W" => KeyModifiers::SUPER, | ||
| "H" => KeyModifiers::HYPER, | ||
| "M" => KeyModifiers::META, | ||
| _ => KeyModifiers::NONE, |
There was a problem hiding this comment.
An unknown modifier should probably be an error, not a silent fallback to no modifier.
|
@max-niederman thanks for the requested changes, i am new to rust, and i will work on these as soon as possible!! |
|
@max-niederman I have made the changes, can you resolve the doubts i have? |
…s like char. Used str::chars iterator for this.
|
Can't say if this is a feature part of the goals of ttyper or not? It turns it from a typing test to a text-manipulation test. @max-niederman |
Added key maps in config.