[GH-ISSUE #1250] [Bug] Can't set shortcut with window button #922

Open
opened 2026-02-26 09:33:02 +03:00 by kerem · 1 comment
Owner

Originally created by @TheMikeyRoss on GitHub (Nov 14, 2023).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1250

Originally assigned to: @NickeManarin on GitHub.

Look at this PR https://github.com/NickeManarin/ScreenToGif/pull/955

It seems to work but without the window button.

I'm trying to set win + shift + g as a shortcut but I cant put more than 2 keys (when a window button is part of the combination). My version is the latest 2.39

Originally created by @TheMikeyRoss on GitHub (Nov 14, 2023). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1250 Originally assigned to: @NickeManarin on GitHub. Look at this PR https://github.com/NickeManarin/ScreenToGif/pull/955 It seems to work but without the window button. I'm trying to set `win + shift + g` as a shortcut but I cant put more than 2 keys (when a window button is part of the combination). My version is the latest `2.39`
Author
Owner

@pawlos commented on GitHub (Nov 20, 2023):

@TheMikeyRoss As far as I checked, in the current code, Windows key is not treated as a modifier (similar to ctrl, alt or shift) but as a regular key (also I can see .NET doesn't return it in modifiers collection).

So you can have shift+windows in the same way as shift+g but you can't have win+shift+g. I can also see that win, key is also partially excluded by the property AllowAllKeys that is set to false for the shortcut controls.

I think that the check and the comment in the lines
https://github.com/NickeManarin/ScreenToGif/blob/master/ScreenToGif/Controls/KeyBox.cs#L286C1-L287C76
are invalid (stating and treating Windows as a modifier) as in this particular case IsWindowsDown won't be true. This is the part of the code where AllowAllKeys = false (else for https://github.com/NickeManarin/ScreenToGif/blob/master/ScreenToGif/Controls/KeyBox.cs#L248) and thus this didn't happen github.com/NickeManarin/ScreenToGif@ccd9b0d49b/ScreenToGif/Controls/KeyBox.cs (L234C8-L235C90) so IsWindowsDown will have the default value.

Additionally many of the win shortcuts are used in the windows itself and that might be causing the issue.

Maybe with some major rewrite (or in V3) it will be possible to cover such case. Again, this is just my few thought looking at my aforementioned PR #955 and the code.

<!-- gh-comment-id:1819827600 --> @pawlos commented on GitHub (Nov 20, 2023): @TheMikeyRoss As far as I checked, in the current code, `Windows` key is not treated as a modifier (similar to ctrl, alt or shift) but as a regular key (also I can see .NET doesn't return it in modifiers collection). So you can have shift+windows in the same way as shift+g but you can't have win+shift+g. I can also see that win, key is also partially excluded by the property `AllowAllKeys` that is set to false for the shortcut controls. I think that the check and the comment in the lines https://github.com/NickeManarin/ScreenToGif/blob/master/ScreenToGif/Controls/KeyBox.cs#L286C1-L287C76 are invalid (stating and treating Windows as a modifier) as in this particular case `IsWindowsDown` won't be true. This is the part of the code where `AllowAllKeys = false` (else for https://github.com/NickeManarin/ScreenToGif/blob/master/ScreenToGif/Controls/KeyBox.cs#L248) and thus this didn't happen https://github.com/NickeManarin/ScreenToGif/blob/ccd9b0d49bdbd180beebc1175ca2ef51e9755374/ScreenToGif/Controls/KeyBox.cs#L234C8-L235C90 so `IsWindowsDown` will have the default value. Additionally many of the `win` shortcuts are used in the windows itself and that might be causing the issue. Maybe with some major rewrite (or in V3) it will be possible to cover such case. Again, this is just my few thought looking at my aforementioned PR #955 and the code.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#922
No description provided.