pub(crate) fn create_keyboard_handler<F>(
    xkb_config: XkbConfig<'_>,
    repeat_delay: i32,
    repeat_rate: i32,
    logger: &::slog::Logger,
    focus_hook: F,
) -> Result<KeyboardHandle, Error>
where
    F: FnMut(Option<&WlSurface>) + 'static,
{
    let log = logger.new(o!("smithay_module" => "xkbcommon_handler"));
    info!(log, "Initializing a xkbcommon handler with keymap query";
        "rules" => xkb_config.rules, "model" => xkb_config.model, "layout" => xkb_config.layout,
        "variant" => xkb_config.variant, "options" => &xkb_config.options
    );
    let internal =
        KbdInternal::new(xkb_config, repeat_rate, repeat_delay, Box::new(focus_hook)).map_err(|_| {
            debug!(log, "Loading keymap failed");
            Error::BadKeymap
        })?;

    info!(log, "Loaded Keymap"; "name" => internal.keymap.layouts().next());

    let keymap = internal.keymap.get_as_string(xkb::KEYMAP_FORMAT_TEXT_V1);

    Ok(KeyboardHandle {
        arc: Rc::new(KbdRc {
            internal: RefCell::new(internal),
            keymap,
            logger: log,
        }),
    })
}
/// Create a keyboard handler from a set of RMLVO rules
Create a keyboard handler from a set of RMLVO rules
Create a keyboard handler from a set of RMLVO rules
pub(crate) fn create_keyboard_handler<F>(
    xkb_config: XkbConfig<'_>,
    repeat_delay: i32,
    repeat_rate: i32,
    logger: &::slog::Logger,
    focus_hook: F,
) -> Result<KeyboardHandle, Error>
where
    F: FnMut(Option<&WlSurface>) + 'static,
{
    let log = logger.new(o!("smithay_module" => "xkbcommon_handler"));
    info!(log, "Initializing a xkbcommon handler with keymap query";
        "rules" => xkb_config.rules, "model" => xkb_config.model, "layout" => xkb_config.layout,
        "variant" => xkb_config.variant, "options" => &xkb_config.options
    );
    let internal =
        KbdInternal::new(xkb_config, repeat_rate, repeat_delay, Box::new(focus_hook)).map_err(|_| {
            debug!(log, "Loading keymap failed");
            Error::BadKeymap
        })?;
    info!(log, "Loaded Keymap"; "name" => internal.keymap.layouts().next());
    let keymap = internal.keymap.get_as_string(xkb::KEYMAP_FORMAT_TEXT_V1);
    Ok(KeyboardHandle {
        arc: Rc::new(KbdRc {
            internal: RefCell::new(internal),
            keymap,
            logger: log,
        }),
    })
}
pub ( crate ) fn create_keyboard_handler < F > ( xkb_config : XkbConfig < ' _ > , repeat_delay : i32 , repeat_rate : i32 , logger : & :: slog :: Logger , focus_hook : F , ) -> Result < KeyboardHandle , Error > where F : FnMut ( Option < & WlSurface > ) + ' static , { let log = logger . new ( o ! ( " " " " ) ) ; info ! ( log " " " " xkb_config rules " " xkb_config model " " xkb_config layout " " xkb_config variant " " xkb_config options ) ; let internal = KbdInternal :: new ( xkb_config , repeat_rate , repeat_delay , Box :: new ( focus_hook ) ) . map_err ( | _ | { debug ! ( log " " ) ; Error :: BadKeymap } ) ? ; info ! ( log " " " " internal keymap layouts ( ) next ( ) ) ; let keymap = internal . keymap . get_as_string ( xkb :: KEYMAP_FORMAT_TEXT_V1 ) ; Ok ( KeyboardHandle { arc : Rc :: new ( KbdRc { internal : RefCell :: new ( internal ) , keymap , logger : log , } ) , } ) }
Create a keyboard handler from a set of RMLVO rules
Create a keyboard handler from a set of RMLVO rules
xkb_config
XkbConfig<'_>
repeat_delay
i32
repeat_rate
i32
logger
&::slog::Logger
focus_hook
F
xkb_config
XkbConfig<'_>
repeat_delay
i32
repeat_rate
i32
logger
&::slog::Logger
focus_hook
F