Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] [Very low priority] F13 Print Screen #45

Open
EETagent opened this issue Aug 18, 2020 · 9 comments
Open

[Feature request] [Very low priority] F13 Print Screen #45

EETagent opened this issue Aug 18, 2020 · 9 comments

Comments

@EETagent
Copy link
Contributor

EETagent commented Aug 18, 2020

Hi, as many of us have PrtSc mapped as a F13 and F13 assigned to fullscreen screenshot in keyboard settings, it may be a good idea to implement this into the Thinkpad Assistant so Cmd + Shift + 3 could be preserved for more native macOS experience.

Snímek obrazovky 2020-08-18 v 14 58 23

@MSzturc
Copy link
Owner

MSzturc commented Aug 18, 2020

Ive tried it a couple months ago. Its not possible for a sandbox application to start another application ( for secure purpose ).

@EETagent
Copy link
Contributor Author

EETagent commented Aug 18, 2020

@MSzturc Using screencapture is one way. It looks like there is some option using XCTest framework ( XCUIScreen, screenshot() ). It is not definitely optimal solution ( if it is even possible ) though. It sad that Apple does not provide more optimal way to access system services.

Maybe @igorkulman can tell more.

@igorkulman
Copy link
Contributor

igorkulman commented Aug 18, 2020

@MSzturc Using screencapture is one way. It looks like there is some option using XCTest framework ( XCUIScreen, screenshot() ). It is not definitely optimal solution ( if it is even possible ) though. It sad that Apple does not provide more optimal way to access system services.

Maybe @igorkulman can tell more.

If get it you are looking for a way to programmatically make a screenshot?

This captures the main display as image

let displayId = CGMainDisplayID()
let image = CGDisplayCreateImage(displayId)

I tried it and it works, just asks the user to allow the app to take screenshot the first time on Catalina.

@EETagent
Copy link
Contributor Author

EETagent commented Aug 18, 2020

@igorkulman Thanks, how come i didn't noticed it ...

IMG
(Generated with Thinkpad Assistant) Definitely possible to implement

@EETagent
Copy link
Contributor Author

EETagent commented Aug 18, 2020

@MSzturc Do you think that there should be menu item for it?

Also what would be ideal format for filename? Screenshot, Snímek obrazovky, etc. is completely unnecessary and would complicate translation ( Even that NSLocalizedString could be used ) of this function so I think we should not include that. There are also differences between 24 and 12 hour format

@EETagent
Copy link
Contributor Author

EETagent commented Aug 18, 2020

@MSzturc
So everything is pretty much finished. We need to think about universal screenshot naming and whether to use PNG or JPEG
Screenshot
( GitHub should really start supporting WebP, HQ GIFs are so huge )

Current progress

  • Menu item for enabling/disabling screenshot
  • Taking screenshots
  • Proper file naming Currently "yyyy-MM-dd' 'HH.mm.ss'.jpg'"
  • JPEG vs PNG I would personally choose JPEG ( File size savings are big ), Apple uses PNG though
  • Check if permission is granted
  • Display window why ThinkpadAssistant needs screen recording permission ( Even though its self-explanatory )
    Snímek obrazovky 2020-08-19 v 10 17 37
  • Localizable alert window content
  • Added "Do not show this again" for those who like blank screenshots :)
    Snímek obrazovky 2020-08-19 v 12 28 48

@bdragonh
Copy link

@MSzturc
How does t480s support prtsc_ To_ F13 ?
SSDT- KBD.AML How to modify it?

@EETagent
Copy link
Contributor Author

EETagent commented Sep 13, 2020

@bdragonh
https://github.com/EETagent/T480-OpenCore-Hackintosh/blob/1af92e1805b3aa62b9c9cdda3af61dc02997be5e/Other/Disassembled%20ACPI/SSDT-KBRD.dsl#L283

You would need to assign F13 to screenshot in keyboard preferences or use Thinkpad Assistant build with #46 included.

@bdragonh
Copy link

bdragonh commented Sep 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants