Struct rm_config::keymap::KeymapConfig
source · pub struct KeymapConfig {
pub general: KeybindsHolder<GeneralAction>,
pub torrents_tab: KeybindsHolder<TorrentsAction>,
pub search_tab: KeybindsHolder<SearchAction>,
pub general_keymap: HashMap<(KeyCode, KeyModifiers), Action>,
pub torrent_keymap: HashMap<(KeyCode, KeyModifiers), Action>,
pub search_keymap: HashMap<(KeyCode, KeyModifiers), Action>,
}Fields§
§general: KeybindsHolder<GeneralAction>§torrents_tab: KeybindsHolder<TorrentsAction>§search_tab: KeybindsHolder<SearchAction>§general_keymap: HashMap<(KeyCode, KeyModifiers), Action>§torrent_keymap: HashMap<(KeyCode, KeyModifiers), Action>§search_keymap: HashMap<(KeyCode, KeyModifiers), Action>Implementations§
source§impl KeymapConfig
impl KeymapConfig
pub const FILENAME: &'static str = "keymap.toml"
pub const DEFAULT_CONFIG: &'static str = "[general]\nkeybindings = [\n { on = \"?\", action = \"ShowHelp\", show_in_help = false },\n { on = \"F1\", action = \"ShowHelp\", show_in_help = false },\n\n { on = \"q\", action = \"Quit\" },\n { on = \"Esc\", action = \"Close\" },\n { on = \"Enter\", action = \"Confirm\" },\n { on = \" \", action = \"Select\" },\n { on = \"Tab\", action = \"SwitchFocus\" },\n { on = \"/\", action = \"Search\" },\n { on = \"o\", action = \"XdgOpen\" },\n \n { on = \"1\", action = \"SwitchToTorrents\" },\n { on = \"2\", action = \"SwitchToSearch\" },\n\n { on = \"Home\", action = \"GoToBeginning\" },\n { on = \"End\", action = \"GoToEnd\" },\n { on = \"PageUp\", action = \"ScrollPageUp\", show_in_help = false },\n { on = \"PageDown\", action = \"ScrollPageDown\", show_in_help = false },\n\n { modifier = \"Ctrl\", on = \"u\", action = \"ScrollPageUp\" },\n { modifier = \"Ctrl\", on = \"d\", action = \"ScrollPageDown\" },\n\n # Arrows\n { on = \"Left\", action = \"Left\" },\n { on = \"Right\", action = \"Right\" },\n { on = \"Up\", action = \"Up\"},\n { on = \"Down\", action = \"Down\" },\n\n # Vi\n { on = \"h\", action = \"Left\" },\n { on = \"l\", action = \"Right\" },\n { on = \"k\", action = \"Up\" },\n { on = \"j\", action = \"Down\" },\n\n # Sorting\n { on = \"H\", action = \"MoveToColumnLeft\"},\n { on = \"L\", action = \"MoveToColumnRight\"},\n]\n\n[torrents_tab]\nkeybindings = [\n { on = \"a\", action = \"AddMagnet\" },\n { on = \"m\", action = \"MoveTorrent\" },\n { on = \"c\", action = \"ChangeCategory\" },\n { on = \"p\", action = \"Pause\" },\n { on = \"f\", action = \"ShowFiles\" },\n { on = \"s\", action = \"ShowStats\" },\n\n { on = \"d\", action = \"Delete\" },\n]\n\n[search_tab]\nkeybindings = [\n { on = \"p\", action = \"ShowProvidersInfo\" }\n]\n\n"
pub fn init() -> Result<Self>
pub fn get_keys_for_action_joined(&self, action: Action) -> Option<String>
pub fn get_keys_for_action(&self, action: Action) -> Option<Vec<String>>
pub fn path() -> &'static PathBuf
Trait Implementations§
source§impl Clone for KeymapConfig
impl Clone for KeymapConfig
source§fn clone(&self) -> KeymapConfig
fn clone(&self) -> KeymapConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'de> Deserialize<'de> for KeymapConfig
impl<'de> Deserialize<'de> for KeymapConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeymapConfig
impl RefUnwindSafe for KeymapConfig
impl Send for KeymapConfig
impl Sync for KeymapConfig
impl Unpin for KeymapConfig
impl UnwindSafe for KeymapConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more