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] Remap print-screen activation key on Windows #1341

Open
T3rminat0r opened this issue Feb 17, 2021 · 56 comments
Open

[Feature Request] Remap print-screen activation key on Windows #1341

T3rminat0r opened this issue Feb 17, 2021 · 56 comments
Labels
Enhancement Feature requests and code enhancements Windows Windows specific issues

Comments

@T3rminat0r
Copy link
Contributor

T3rminat0r commented Feb 17, 2021

I'd love to modify the Shortcut used for a Screencapture on windows (flameshot already running)

Flameshot-Version: 0.8.4 (couldn't find any newer Windows MSI package)

OS: Windows 10 (20H2)

I've been using flameshot on Linux, for a long time, and never found a suitable alternative for use on Windows, so, I was happy to find out there's windows versions available, now (didn't check in a while...)
On Linux, I just set up a global shortcut (ctrl+y, in my case) to start flameshot gui, and am quite happy with that. On Windows, I can't (easily?) do that (at least I've not found any documentation for it, and plainly calling flameshot.exe gui does nothing)
The Windows Flameshot does come with local Shortcuts, though, while it's running... I'd just love to remap the PrintScreen one to a different shortcut (either in the .conf file or via a UI?)
Is this still a thing, and I just missed the documentation for it? Is it maybe already planned for a comming release? Or am I just thinking in the wrong direction and the solution to my problem is something else? (please don't say "just press printscreen" ;) )

Thanks for developing this great tool, there literally is none with as great a UX feeling as flameshot.

@borgmanJeremy
Copy link
Contributor

just press printscreen :) (just kidding)

Right now there is not a way to override the printscreen activation on windows. I've tagged this as a future feature request.

@borgmanJeremy borgmanJeremy changed the title Flameshot on Windows and shortcuts [Feature Request] Remap print-screen activation key on Windows Feb 19, 2021
@borgmanJeremy
Copy link
Contributor

Believe this is the relevant section of code:

connect(nativeFilter, &GlobalShortcutFilter::printPressed, this, [this]() {

Quite busy with the 0.9 release so I will come back to this later or someone else might tackle it.

@dontworryseoul

This comment was marked as duplicate.

@mmahmoudian mmahmoudian added Enhancement Feature requests and code enhancements Windows Windows specific issues labels Mar 7, 2021
@WeridoLm

This comment was marked as off-topic.

2 similar comments
@WeridoLm

This comment was marked as duplicate.

@WeridoLm

This comment was marked as duplicate.

@TroyWilliams3687
Copy link

TroyWilliams3687 commented Apr 16, 2021

I have switched to flameshot on linux (Ubuntu 20.04) earlier this year and quite enjoy it. So I wanted to use it on my windows computer. I wanted to set the shortcuts to match my Linux box (muscle memory and all). I can live with just hitting print screen until this is settled. However, I converted a colleague and he is having trouble. Apparently, the corporate version of onedrive has taken the printscreen key over. Without getting IT involved he can't use flameshot.

I would like to see a configuration option for the keyboard shortcut.

@Kin-Zhang
Copy link

Yes! I also think it's necessary for Windows user to config print-screen shortcut

by the way, my PrtSc key didn't remap to flameshot too, so I use it by clicking the logo on the taskbar

@NirmalManoj

This comment was marked as off-topic.

@Kin-Zhang
Copy link

I want to see this feature. I have been using Flameshot on Manjaro for some months now. It is by far the best screenshot tool I have across. It is feature-rich and slick at the same time.

Like @Kin-Zhang, I have also not been able to use Print-Screen shortcut on Windows. Did @Kin-Zhang find a way to fix this? If anyone knows how to fix this, please tell me and also put in the documentation. I think this is a common issue.

I didn't fix it, but I finally have the PrtSc with flameshot but I don't know why it works and also don't know when it's fix maybe after I restart my computer? actually I don't know.... But now I can use the PrtSc key to activate flameshot.

@VijayKM01
Copy link

I, too, was waiting eagerly for this feature, however was able to finally get PrtScr to bring up the Flameshot gui by disabling a toggle which brings of the screen snipping tool when the PrtScr key is pressed.

I believe the feature to set a print screen shortcut was introduced in a recent Windows update (probably in version 1903)
To turn off the new snipping feature keyboard shortcut Select Start > Settings > Ease of Access > Keyboard > Turn off the Print Screen shortcut toggle.
After a restart, the PrtScr should bring up the Flameshot gui (ensure that flameshot is running in the background for this to work).

This is what worked for me, but I feel a future Windows update may easily break this workaround, therefore it would be great if the devs could implement the key-remap feature for windows.

P.S. Flameshot is the best screen capture tool i've come across, its especially helpful in this era of online meetings and classes. Kudos to the devs and all the people who've helped in creating and maintaining this amazing FOSS tool.

@T3rminat0r
Copy link
Contributor Author

@VijayKM01 Using PrtScr for triggering FlameShot works fine. This Issue is about being able to map other triggering Keys, within Flameshot to trigger a capture (For example, I'd like to map CTRL+Y to capture (yes, german layout keyboard, Y is below a)

@VijayKM01
Copy link

Oh, my bad, I misunderstood the issue being discussed, I stumbled across this as I was trying to get PrtScr to bring up the FlameShot gui. Nonetheless, I do believe PrtScr is not in the most convenient spot, and it would be great to have an option for additional key triggers.

@adityagovindaraj
Copy link

Yes! I also think it's necessary for Windows user to config print-screen shortcut

by the way, my PrtSc key didn't remap to flameshot too, so I use it by clicking the logo on the taskbar

Yeah, same here. When I use PrtScrn, it opens Windows Screenshot, not Flameshot. I have to use taskbar to open Flameshot.

@Rar9

This comment was marked as off-topic.

@RawMew

This comment was marked as duplicate.

@borgmanJeremy
Copy link
Contributor

Up for Windows.

Theme was opened one year ago, nothing changed since then

This isn't helpful. Nothing changes unless you help do the work. There is a PR in progress on this.

@mmahmoudian
Copy link
Member

mmahmoudian commented Apr 26, 2022

⚠️ I'm going to hide non-constructive comments to unclog this issue (including this comment which will get hidden after some hours so that everyone can see it before that seems we are getting more comments that are not adding anything to this thread, so I'll keep this message visible!)

@krokofant

This comment was marked as off-topic.

@mmahmoudian
Copy link
Member

mmahmoudian commented May 13, 2022

@krokofant your comment is certainly not constructive and I'm going to hide it.

I personally don't see a point of making something specifically for Windows when it can already be easily done since Win95 or Win98.

This is one solution:

https://www.perkinselearning.org/technology/blog/how-create-custom-keyboard-shortcuts-windows

You can create a desktop shortcut and in Properties define a shortcut as explained in this link. It is easy, fast, straightforward, and native to Windows.

@krokofant
Copy link

I personally don't see a point of making something specifically for Windows when it can already be easily done since Win95 or Win98.

This is one solution:

https://www.perkinselearning.org/technology/blog/how-create-custom-keyboard-shortcuts-windows

You can create a desktop shortcut and in Properties define a shortcut as explained in this link. It is easy, fast, straightforward, and native to Windows.

I'm not sure what you imagine this would help with. Since there's no CLI support for Windows adding a keyboard shortcut for flameshot won't do much. If CLI support was there, then I can see the point of creating a keyboard shortcut directly to open flameshot.

@mmahmoudian
Copy link
Member

@krokofant that is a fair point. Sorry for jumping to conclusion so quickly. I often forget that the CLI is not there for Windows.

@zz940522
Copy link

I'd love to modify the Shortcut used for a Screencapture on windows (flameshot already running)

Flameshot-Version: 0.8.4 (couldn't find any newer Windows MSI package)

OS: Windows 10 (20H2)

I've been using flameshot on Linux, for a long time, and never found a suitable alternative for use on Windows, so, I was happy to find out there's windows versions available, now (didn't check in a while...) On Linux, I just set up a global shortcut (ctrl+y, in my case) to start flameshot gui, and am quite happy with that. On Windows, I can't (easily?) do that (at least I've not found any documentation for it, and plainly calling flameshot.exe gui does nothing) The Windows Flameshot does come with local Shortcuts, though, while it's running... I'd just love to remap the PrintScreen one to a different shortcut (either in the .conf file or via a UI?) Is this still a thing, and I just missed the documentation for it? Is it maybe already planned for a comming release? Or am I just thinking in the wrong direction and the solution to my problem is something else? (please don't say "just press printscreen" ;) )

Thanks for developing this great tool, there literally is none with as great a UX feeling as flameshot.

Hello, I find a way to set a shortcut for flameshot,please use autohotkeys.

  1. I set Ctrl+Alt+a remap to PrtSc,this will work for you
  2. Please download autohotkeys here
    https://www.autohotkey.com/
  3. autohotkeys official doc is here https://www.autohotkey.com/docs/commands/Send.htm
    image
  4. U can add this script to Start up folder
    image
  5. C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

@simetron
Copy link

simetron commented Jun 2, 2022

I'd love to modify the Shortcut used for a Screencapture on windows (flameshot already running)
Flameshot-Version: 0.8.4 (couldn't find any newer Windows MSI package)
OS: Windows 10 (20H2)
I've been using flameshot on Linux, for a long time, and never found a suitable alternative for use on Windows, so, I was happy to find out there's windows versions available, now (didn't check in a while...) On Linux, I just set up a global shortcut (ctrl+y, in my case) to start flameshot gui, and am quite happy with that. On Windows, I can't (easily?) do that (at least I've not found any documentation for it, and plainly calling flameshot.exe gui does nothing) The Windows Flameshot does come with local Shortcuts, though, while it's running... I'd just love to remap the PrintScreen one to a different shortcut (either in the .conf file or via a UI?) Is this still a thing, and I just missed the documentation for it? Is it maybe already planned for a comming release? Or am I just thinking in the wrong direction and the solution to my problem is something else? (please don't say "just press printscreen" ;) )
Thanks for developing this great tool, there literally is none with as great a UX feeling as flameshot.

Hello, I find a way to set a shortcut for flameshot,please use autohotkeys.

1. I set Ctrl+Alt+a remap to PrtSc,this will work for you

2. Please download autohotkeys here
   https://www.autohotkey.com/

3. autohotkeys official doc is here https://www.autohotkey.com/docs/commands/Send.htm
   ![image](https://user-images.githubusercontent.com/33046965/168416997-15949ee1-3422-4d8f-8266-590999d4139b.png)

4. U can add this script to Start up folder
   ![image](https://user-images.githubusercontent.com/33046965/168417187-5ae37485-1ab0-4941-acfe-fe6fe6e4439f.png)

5. C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Thank you for the idea, worked like a charm! A bit messy but this is how looks mine

imagen

@NorthernLaw1500
Copy link

@mmahmoudian
I went through the options for pixel size and couldn't find it, could you perhaps point me in the right direction?

Interesting, I'd love to see it. Personally I'd rather learn C++ and do it myself but just as an ease of access thing I might end up doing that, I'll look into it for sure. I didn't know Flameshot was that new to Windows, knew it was originally designed for Linux but that's it.

Thank you for your help and knowledge, very much appreciated.

@mmahmoudian
Copy link
Member

@NorthernLaw1500

I went through the options for pixel size and couldn't find it, could you perhaps point me in the right direction?

I don't know much about your setup installation method, Flameshot version, ...) therefore very hard for me to help. But here are some facts:

  • it is implemented after the 12.1.0 was released
  • if you are Arch-based Linux distro, you can install it via AUR.
  • If you are on some other Linux distro or another operating system, you can install from our development build which should be considered as non-stable versions, although in Flameshot project it is typically stable enough for daily use.

Thank you for your help and knowledge, very much appreciated.

You are most welcome. I'm glad that I was helpful

@mercster
Copy link

mercster commented May 16, 2023

Hah... so I came here to find, unfortunately, you can't bind naked PrtScn to open Flameshot. Fine, I'm adaptable, I'll just go into the configuration and change the hotkey for opening a screenshot, like Shift-PrtScn. But Flameshot doesn't let you change this under Windows. 😂 Any reason why those last few hotkeys at the bottom (you know... the most important ones) can't be rebound? If I could just change opening Flameshot to Shift-PrtScn, everything's gravy. Thanks for the tool.

EDIT: I rebooted and now PrtScn is firing up Flameshot just fine. Who knows!

@NorthernLaw1500
Copy link

@mercster

Any reason why those last few hotkeys at the bottom (you know... the most important ones) can't be rebound?

Well I'll be honest, I have no clue as that is the most important thing you are right, also other screenshot applications such as Lightshot have it. Of course can't expect everything with open source software but that still confuses me. If you read above it was explained a bit but basically just have to deal with it until someone changes it or make a code bounty.

Luckily I found a workaround that works for myself, using my Stream Deck I can set it to one of those keys and while it's not technically a keybind on the keyboard, it works as one. Still wish you could just rebind it normally but maybe it will come one day.

@mercster
Copy link

I actually rebooted and... Flameshot is now capturing the PrtScn key just fine. Who knows, Windows is wonky. I should edit my above post.

@web-dev-passion
Copy link

I actually rebooted and... Flameshot is now capturing the PrtScn key just fine. Who knows, Windows is wonky. I should edit my above post.

Happened to me as well. 😄 So it seems that (at least on Windows 11 22H2) you have to deactivate the Snipping Tool in the Windows Settings.

  1. Settings > Ease of Access > Keyboard > Use the PrtScn button to open screen snipping > OFF
    (or just search for it in the search bar)

  2. (Optional) Make sure Flameshot gets started on boot:

  3. Settings > General > Start automatically > ON

  4. Reboot your system. The PrtScn key should now trigger Flameshot 👍🏼

@mmahmoudian
Copy link
Member

@web-dev-passion this is already listed in our troubleshooting documentation for Windows users:

https://flameshot.org/docs/guide/windows-help/#how-to-disable-windows-snipping-tool-when-i-press-printscreen

It seems every now and then after some Windows updates, this setting is reverted without informing user (classic Microsoft move) and users have to apply this setting again.

@mjarsky
Copy link

mjarsky commented Aug 18, 2023

Just chiming in for this too.

I am right-handed, so to use the current PrtScn shortcut, I have to take my hand off the mouse.

I much prefer shortcuts I can invoke with my left hand, e.g., Windows Key + S

P.S. Thank you for creating this tool!

@mjarsky
Copy link

mjarsky commented Aug 18, 2023


Donated!

@mmahmoudian
Copy link
Member

Just for the record and connecting issues to PRs, we have a partial implementation in #2168

@NyQuilD

This comment has been minimized.

@rouninhp
Copy link

Yes! I also think it's necessary for Windows user to config print-screen shortcut

by the way, my PrtSc key didn't remap to flameshot too, so I use it by clicking the logo on the taskbar

Same was happening to me. What seems to have fixed is:

  1. Go to Windows Settings > accessibility > keyboard > turn off use the print screen key to open screen capture
  2. Restart flameshot.
    After these simples steps, my PrtSc key started to take screenshots using flameshot and I no longer have to click on logo on the taskbar.

@nicl-dev
Copy link

nicl-dev commented Jan 6, 2024

@web-dev-passion this is already listed in our troubleshooting documentation for Windows users:

https://flameshot.org/docs/guide/windows-help/#how-to-disable-windows-snipping-tool-when-i-press-printscreen

It seems every now and then after some Windows updates, this setting is reverted without informing user (classic Microsoft move) and users have to apply this setting again.

This does not work for me on Windows 11 10.0.22635 Build 22635.
Even after a restart windows still opens the snipping tool when I'm hitting print for whatever reason. :(

image

@vanjaz
Copy link

vanjaz commented Feb 2, 2024

Thank you @rouninhp this worked perfectly for me.
Note I did previously uninstall snipping tool, but flameshot would still not work until I turned off the toggle you mentioned.

@eazyAlf
Copy link

eazyAlf commented Feb 14, 2024

Just for the record and connecting issues to PRs, we have a partial implementation in #2168

@mmahmoudian is alt + print screen implemented? because it doesn't work for me
i recently changed my keyboard and dont have a print-screen button anymore.
are there native workarounds without autohotkey?

@maisonhai3
Copy link

Yes! I also think it's necessary for Windows user to config print-screen shortcut
by the way, my PrtSc key didn't remap to flameshot too, so I use it by clicking the logo on the taskbar

Same was happening to me. What seems to have fixed is:

  1. Go to Windows Settings > accessibility > keyboard > turn off use the print screen key to open screen capture
  2. Restart flameshot.
    After these simples steps, my PrtSc key started to take screenshots using flameshot and I no longer have to click on logo on the taskbar.

This works like a charm.
Windows 11 Home 23H2.

@T3rminat0r
Copy link
Contributor Author

This works like a charm. Windows 11 Home 23H2.

Yes, that works, this Issue is about binding OTHER Keys for capturing with FlameShot, though :)

@leetrout
Copy link

leetrout commented Jul 17, 2024

EDIT Turns out my keyboard is sending F13 not PrintScreen so I fixed this with an auto hotkey script.

#Requires AutoHotkey v2.0
#SingleInstance
F13::Send '{PrintScreen}'
return

Confirming that on windows 10 print screen does not open flameshot even with the accessibility changes set and computer restarted. :-/

I also read over #1118

@XOCODE-OP
Copy link

In my case I just wanna bind flameshot summoning to key MOUSE 4,

aka a mouse side buttons.
I promise you if you tried it you would love it. Screenshot for me just means: move thumb forwards. muscle memory very fast (doing it in shareX so far)
I think this is way faster than reaching over to the print key. Which means taking off my hands off the mouse reaching over to the print screen, going back to the mouse and then selecting what I want.

@ccll
Copy link

ccll commented Aug 27, 2024

just press printscreen :) (just kidding)

I just bought a keyboard with no 'Print Screen' key on it (no kidding!) 😂
Still trying desperately to find a way to use my favourite FlameShot. 😭

image

@yani-
Copy link

yani- commented Aug 30, 2024

Change Print Screen to Ctrl + Shift + 4

❯ git diff
diff --git a/src/core/globalshortcutfilter.cpp b/src/core/globalshortcutfilter.cpp
index c98b18f4..4298d15b 100644
--- a/src/core/globalshortcutfilter.cpp
+++ b/src/core/globalshortcutfilter.cpp
@@ -16,6 +16,10 @@ GlobalShortcutFilter::GlobalShortcutFilter(QObject* parent)
     if (RegisterHotKey(NULL, 2, MOD_SHIFT, VK_SNAPSHOT)) {
         // ok - show screenshots history
     }
+
+    if (RegisterHotKey(NULL, 3, MOD_CONTROL | MOD_SHIFT, 0x34)) {
+        // ok - request capture
+    }
 }

 bool GlobalShortcutFilter::nativeEventFilter(const QByteArray& eventType,
@@ -37,8 +41,8 @@ bool GlobalShortcutFilter::nativeEventFilter(const QByteArray& eventType,
             Flameshot::instance()->history();
         }

-        // Capture screen
-        if (VK_SNAPSHOT == keycode && 0 == modifiers) {
+        // Change this condition to check for Ctrl + Shift + 4
+        if (keycode == 0x34 && (modifiers & MOD_CONTROL) && (modifiers & MOD_SHIFT)) {
             Flameshot::instance()->requestCapture(
               CaptureRequest(CaptureRequest::GRAPHICAL_MODE));
         }

@TinyOvenDad
Copy link

Just want to share that I use Windows PowerToys for a workaround here. It allows you to remap input character(s) and send a shortcut. For example, input Ctrl + `, send PrintScreen. Works like a charm, easy to set up too.

image

PowerToys Keyboard Manager

@XOCODE-OP
Copy link

I use autohotkey and I suppose I would take Ctrl + Shift + 4 but it should be easy to implement an arbitrary remapped key to activate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and code enhancements Windows Windows specific issues
Projects
None yet
Development

No branches or pull requests