keypress_simulator

Creator: coderz1093

Last updated:

Add to Cart

Description:

keypress simulator

keypress_simulator #

This plugin allows Flutter desktop apps to simulate key presses.

English | 简体中文




Platform Support
Quick Start

Installation
Usage


Who's using it?
License


Platform Support #



Linux
macOS
Windows





✔️
✔️



Quick Start #
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
keypress_simulator: ^0.2.0
copied to clipboard
Usage #
import 'package:keypress_simulator/keypress_simulator.dart';

// 1. Simulate pressing ⌘ + C

// 1.1 Simulate key down
await keyPressSimulator.simulateKeyDown(
PhysicalKeyboardKey.keyC,
[ModifierKey.metaModifier],
);

// 1.2 Simulate key up
await keyPressSimulator.simulateKeyUp(
PhysicalKeyboardKey.keyC,
[ModifierKey.metaModifier],
);

// 2. Simulate long pressing ⌘ + space

// 2.1. Simulate key down
await keyPressSimulator.simulateKeyDown(
PhysicalKeyboardKey.space,
[ModifierKey.metaModifier],
);

await Future.delayed(const Duration(seconds: 5));

// 2.2. Simulate key up
await keyPressSimulator.simulateKeyUp(
PhysicalKeyboardKey.space,
[ModifierKey.metaModifier],
);
copied to clipboard

Please see the example app of this plugin for a full example.

Who's using it? #

Biyi (比译) - A convenient translation and dictionary app.

License #
MIT

License

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

Files:

Customer Reviews

There are no reviews.