Keyboard Info

pub license: BSD style: lint CI codecov

This Flutter plugin provides API for querying information about the system's keyboard.

Usage

import 'package:keyboard_info/keyboard_info.dart';

void main() async {
  final KeyboardInfo info = await getKeyboardInfo();
  print(info.layout); // "fi"
  print(info.variant); // "mac"
}

Platform Support

PlatformLayoutVariantNotes
Android
iOS
Linux
  • Cinnamon:
    • org.gnome.libgnomekbd.keyboard layouts
  • GNOME:
    • org.gnome.desktop.input-sources mru-sources
    • org.gnome.desktop.input-sources sources
  • KDE:
    • ~/.local/share/kded5/keyboard/session/layout_memory.xml
    • ~/.config/kxkbrc
  • MATE:
    • org.mate.peripherals-keyboard-xkb.kbd layouts
  • XFCE:
    • ~/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml
  • Fallback: /etc/default/keyboard
macOS
  • TISCopyCurrentKeyboardInputSource()
  • TISGetInputSourceProperty()
    • kTISPropertyInputSourceLanguages
    • kTISPropertyInputSourceID
Web
  • Not available (stubbed)
Windows

Libraries

device_info
Retrieves the system's active keyboard layout etc.