Skip to main content

Crate im_switch

Crate im_switch 

Source
Expand description

A cross-platform input method switcher.

im-switch provides a unified API to query, switch, and list input methods across Linux, Windows, and macOS.

§Platform support

PlatformBackend
Linuxfcitx5 (D-Bus), ibus (CLI) — auto-detected at runtime
WindowsWin32 API (keyboard layout + IME on/off control)
macOSCarbon TIS API

§Quick start

use im_switch::{get_input_method, set_input_method, list_input_methods};

// Get the current input method
let im = get_input_method().unwrap();
println!("Current IM: {im}");

// List available input methods
let methods = list_input_methods().unwrap();
for m in &methods {
    println!("  {m}");
}

// Restore a saved input method
set_input_method(&im).unwrap();

Enums§

ImSwitchError
Error type for input method operations.

Functions§

get_input_method
Returns the current input method identifier.
list_input_methods
Returns a list of available input method identifiers.
set_input_method
Sets the input method to the specified identifier.