https://github.com/pacifio/dart-autogui
A desktop automation library built on top of python's pyautogui module
https://github.com/pacifio/dart-autogui
dart dart-native dart-package desktop-automation pyautogui python
Last synced: 8 months ago
JSON representation
A desktop automation library built on top of python's pyautogui module
- Host: GitHub
- URL: https://github.com/pacifio/dart-autogui
- Owner: pacifio
- License: mit
- Created: 2021-08-13T14:01:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-11T03:25:46.000Z (about 4 years ago)
- Last Synced: 2025-01-01T16:41:16.475Z (9 months ago)
- Topics: dart, dart-native, dart-package, desktop-automation, pyautogui, python
- Language: Dart
- Homepage:
- Size: 72.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Dart Autogui
Dart autogui is a wrapper around python `autogui` module . You need python , `pyautogui` and `pyscreeze` installed in your computer for this package to work .
## Install
Python packages to install
```bash
pip3 install pyautogui pyscreeze
```Dart install
```yaml
dependencies:
dart_autogui: 0.0.1
```Validate your `dart_autogui` installation
```dart
print(await Validate.installed());
// Returns true if all dependencies are installed
// false if dependencies are not resolved
```## Functions
Mouse functions
```dart
getPosition() ✅
moveTo() ✅
moveRel() ✅
dragTo() ✅
dragRel() ✅
click() ✅
rightClick() ✅
middleClick() ✅
doubleClick() ✅
tripleClick() ✅
scroll()
mouseDown()
mouseUp()
onLeftClick()
onRightClick()
```Keyboard functions
```dart
keyboardKeys() ✅
typeWord() ✅
hotKey() ✅
```## Example
```dart
import 'package:dart_autogui/dart_autogui.dart';Future pos() async {
final position = await Mouse.pos();
print("X: ${position.x} , Y: ${position.y}");
}Future moveTo() async {
await Mouse.moveTo(
x: 100,
y: 100,
duration: Duration(seconds: 5),
tween: MouseTween.easeInElastic,
);
}Future moveRel() async {
await Mouse.moveRel(
x: 100,
y: 100,
duration: Duration(seconds: 5),
);
}Future dragTo() async {
await Mouse.dragTo(
x: 100,
y: 100,
duration: Duration(seconds: 5),
tween: MouseTween.easeInElastic,
button: MouseButton.right,
);
}Future dragRel() async {
await Mouse.dragRel(
x: 100,
y: 100,
duration: Duration(seconds: 2),
tween: MouseTween.easeInElastic,
);
}Future rightClick() async {
await Mouse.rightClick(
x: 100, y: 100, clicks: 5, tween: MouseTween.easeInQuad);
}Future keyboardKeys() async {
final data = await Keyboard.keyboardKeys();
data.forEach((element) {
print(element);
});
}Future typeWord() async {
await Keyboard.typeWord('Adib Mohsin', interval: 0);
}Future hotkey() async {
await Keyboard.hotKey(['ctrl', 'v']);
}Future validateInstall() async {
print(await Validate.installed());
}void main() async {
validateInstall();
}
```