-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added key maps in config #104
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!! |
…s like char. Used str::chars iterator for this.
@max-niederman I have made the changes, can you resolve the doubts i have? |
Added key maps in config.