Commit f847dc0
Add native screenshot capture for Mac (POSIX) build
Enable pixel-perfect screenshot capture on the Mac build by reading
directly from the LVGL framebuffer, matching the existing ESP32 behavior.
Changes:
- src/hasp_gui.cpp: Add POSIX file-based screenshot using fopen/fwrite/fclose,
extend bitmap header guard to compile on POSIX, log full absolute path
- src/hasp/hasp_dispatch.cpp: Enable the screenshot command for POSIX builds
- src/drv/tft/tft_driver_sdl2.cpp: Add F12 keyboard shortcut via SDL event watch
using a flag polled from guiLoop() for thread safety
Usage:
- MQTT: publish to hasp/<node>/command/screenshot
- Keyboard: press F12 in the simulator window
- Default output: screenshot.bmp in the working directory
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 57d2ebf commit f847dc0
3 files changed
Lines changed: 91 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
25 | 45 | | |
26 | 46 | | |
27 | 47 | | |
| |||
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
647 | 655 | | |
648 | 656 | | |
649 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
391 | 401 | | |
392 | 402 | | |
393 | 403 | | |
| |||
618 | 628 | | |
619 | 629 | | |
620 | 630 | | |
621 | | - | |
| 631 | + | |
622 | 632 | | |
623 | 633 | | |
624 | 634 | | |
| |||
666 | 676 | | |
667 | 677 | | |
668 | 678 | | |
669 | | - | |
| 679 | + | |
670 | 680 | | |
671 | 681 | | |
672 | 682 | | |
| |||
722 | 732 | | |
723 | 733 | | |
724 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
725 | 785 | | |
726 | 786 | | |
727 | 787 | | |
| |||
0 commit comments