MSzturc / ThinkpadAssistant

An Assistant Application that allows you to use all your Function Keys on a T-Series Thinkpad Laptop
122 stars 13 forks source link

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

Open EETagent opened 4 years ago

EETagent commented 4 years ago

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 commented 4 years ago

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

EETagent commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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

IMG (Generated with Thinkpad Assistant) Definitely possible to implement

EETagent commented 4 years ago

@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 commented 4 years ago

@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

bdragonh commented 4 years ago

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

EETagent commented 4 years ago

@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 commented 4 years ago

Thank you. The screen print key is working.

-------- 原始邮件 -------- 发件人: Vojtěch Jungmann notifications@github.com 日期: 2020年9月13日周日 23:17 收件人: MSzturc/ThinkpadAssistant ThinkpadAssistant@noreply.github.com 抄送: bdragonh bdragonh@msn.com, Comment comment@noreply.github.com 主 题: Re: [MSzturc/ThinkpadAssistant] [Feature request] [Very low priority] F13 Print Screen (#45)

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

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MSzturc/ThinkpadAssistant/issues/45#issuecomment-691684414, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJBELGSPFFBH3IVTDLT2EYTSFTPA5ANCNFSM4QDNX7XQ.