[][src]Function smithay_client_toolkit::keyboard::map_keyboard_auto_with_repeat

pub fn map_keyboard_auto_with_repeat<Impl, RepeatImpl>(
    seat: &WlSeat,
    key_repeat_kind: KeyRepeatKind,
    implementation: Impl,
    repeat_implementation: RepeatImpl
) -> Result<WlKeyboard, Error> where
    Impl: FnMut(Event<'a>, WlKeyboard) + 'static,
    RepeatImpl: FnMut(KeyRepeatEvent, WlKeyboard) + Send + 'static, 

Implement a keyboard to automatically detect the keymap and send KeyRepeatEvents at set intervals

This requires you to provide an implementation to receive the events after they have been interpreted with the keymap. You must also provide an implementation to be called when KeyRepeatEvents are sent at intervals set by the KeyRepeatKind argument, this implementation can be called at anytime, independent of the dispatching of wayland events. The dispatching of KeyRepeatEvents is handled with the spawning of threads.

The keymap information will be loaded from the events sent by the compositor, as such you need to call this method as soon as you have created the keyboard to make sure this event does not get lost.

Returns an error if xkbcommon could not be initialized.