Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,23 @@ Future<void> main() async {

// copy local info
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
await tester.sendKeyEvent(CopyLocalInfoShortcut.logicalKey);
await tester.sendKeyDownEvent(CopyLocalInfoShortcut.logicalKey);
await tester.sendKeyUpEvent(CopyLocalInfoShortcut.logicalKey);
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
await tester.pumpAndSettle();

// copy board image
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
await tester.sendKeyEvent(CaptureBoardImageShortcut.logicalKey);
await tester.sendKeyDownEvent(CaptureBoardImageShortcut.logicalKey);
await tester.sendKeyUpEvent(CaptureBoardImageShortcut.logicalKey);
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
await tester.pumpAndSettle();
await Future<void>.delayed(const Duration(seconds: 1));

// copy moves
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
await tester.sendKeyEvent(CopyMovesShortcut.logicalKey);
await tester.sendKeyDownEvent(CopyMovesShortcut.logicalKey);
await tester.sendKeyUpEvent(CopyMovesShortcut.logicalKey);
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
await tester.pumpAndSettle();
final clipboardDataMoves = await Clipboard.getData(Clipboard.kTextPlain);
Expand Down
5 changes: 4 additions & 1 deletion lib/board/pedax_shortcuts/capture_board_image_shortcut.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class CaptureBoardImageShortcut implements PedaxShortcut {
final pngByteData = await image.toByteData(format: ui.ImageByteFormat.png);
final pngBytes = pngByteData!.buffer.asUint8List();

final file = File('${(await _tmpDir).path}/board_for_clipboard.png');
final tmpDir = await _tmpDir;
if (!tmpDir.existsSync()) await tmpDir.create(recursive: true);

final file = File('${tmpDir.path}/board_for_clipboard.png');
await file.writeAsBytes(pngBytes);
await Pasteboard.writeFiles([file.path]);
}
Expand Down