super_keyboard_layout

Creator: coderz1093

Last updated:

0 purchases

super_keyboard_layout Image
super_keyboard_layout Images

Languages

Categories

Add to Cart

Description:

super keyboard layout

Keyboard layout mapping for Flutter #
Features #

Supports macOS, Windows and Linux
Allows mapping between physical keys, logical keys and platform specific key codes according to current keyboard layout.
Notification for keyboard layout changes.


Getting started #
super_keyboard_layout uses Rust internally to implement low-level platform specific functionality.
If you don't have Rust installed, the plugin will automatically download precompiled binaries for target platform.
If you want to have the Rust code compiled from source instead, you can install Rust through rustup. The presence of rustup will be detected during build automatically.
For macOS or Linux, execute the following command in Terminal.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
copied to clipboard
For Windows, you can use the Rust Installer.
In case you have Rust already installed, make sure to update it to latest version:
rustup update
copied to clipboard
That is it. The build integration will automatically install required Rust targets and other dependencies. This also means that first build might take a little bit longer.
Usage #

import 'package:super_keyboard_layout/super_keyboard_layout.dart';

void main() async {
final manager = await KeyboardLayoutManager.instance();
if (manager.supported) {
// Running on supported platform
manager.onLayoutChanged.addListener(() {
// Keyboard layout changed
print('Keyboard layout changed');
});
}

final layout = manager.currentLayout;

// Getting logical key for physical key 1 with shift for current layout
final logicalKey = layout.getLogicalKeyForPhysicalKey(PhysicalKeyboardKey.digit1, shift: true);

// Getting physical key for logical key
final physicalKey = layout.getPhysicalKeyForLogicalKey(LogicalKeyboardKey.keyA);

// Getting platform spcific key code for either logical or physical key
final playformCode = layout.getPlatformKeyCode(PhysicalKeyboardKey.digit1);
}

copied to clipboard
Running the example #
Example project is available at super_keyboard_layout/example.
flutter pub global activate melos # if you don't have melos already installed
git clone https://github.com/superlistapp/super_native_extensions.git
cd super_native_extensions
melos bootstrap
copied to clipboard
After this you can open the folder in VSCode and run the super_keyboard_layout launcher configuration.
TODO(knopp): Add Intellij launcher configuration
Additional information #
This plugin is in a very early stages of development and quite experimental.
PRs and bug reports are welcome!

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.