File tree Expand file tree Collapse file tree
lib/board/pedax_shortcuts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,20 +101,23 @@ Future<void> main() async {
101101
102102 // copy local info
103103 await tester.sendKeyDownEvent (LogicalKeyboardKey .control);
104- await tester.sendKeyEvent (CopyLocalInfoShortcut .logicalKey);
104+ await tester.sendKeyDownEvent (CopyLocalInfoShortcut .logicalKey);
105+ await tester.sendKeyUpEvent (CopyLocalInfoShortcut .logicalKey);
105106 await tester.sendKeyUpEvent (LogicalKeyboardKey .control);
106107 await tester.pumpAndSettle ();
107108
108109 // copy board image
109110 await tester.sendKeyDownEvent (LogicalKeyboardKey .control);
110- await tester.sendKeyEvent (CaptureBoardImageShortcut .logicalKey);
111+ await tester.sendKeyDownEvent (CaptureBoardImageShortcut .logicalKey);
112+ await tester.sendKeyUpEvent (CaptureBoardImageShortcut .logicalKey);
111113 await tester.sendKeyUpEvent (LogicalKeyboardKey .control);
112114 await tester.pumpAndSettle ();
113115 await Future <void >.delayed (const Duration (seconds: 1 ));
114116
115117 // copy moves
116118 await tester.sendKeyDownEvent (LogicalKeyboardKey .control);
117- await tester.sendKeyEvent (CopyMovesShortcut .logicalKey);
119+ await tester.sendKeyDownEvent (CopyMovesShortcut .logicalKey);
120+ await tester.sendKeyUpEvent (CopyMovesShortcut .logicalKey);
118121 await tester.sendKeyUpEvent (LogicalKeyboardKey .control);
119122 await tester.pumpAndSettle ();
120123 final clipboardDataMoves = await Clipboard .getData (Clipboard .kTextPlain);
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ class CaptureBoardImageShortcut implements PedaxShortcut {
3838 final pngByteData = await image.toByteData (format: ui.ImageByteFormat .png);
3939 final pngBytes = pngByteData! .buffer.asUint8List ();
4040
41- final file = File ('${(await _tmpDir ).path }/board_for_clipboard.png' );
41+ final tmpDir = await _tmpDir;
42+ if (! tmpDir.existsSync ()) await tmpDir.create (recursive: true );
43+
44+ final file = File ('${tmpDir .path }/board_for_clipboard.png' );
4245 await file.writeAsBytes (pngBytes);
4346 await Pasteboard .writeFiles ([file.path]);
4447 }
You can’t perform that action at this time.
0 commit comments