feat: configurable arrow key step size for selection widget#4662
Open
AnveshJarabani wants to merge 1 commit into
Open
feat: configurable arrow key step size for selection widget#4662AnveshJarabani wants to merge 1 commit into
AnveshJarabani wants to merge 1 commit into
Conversation
The selection widget now supports configurable step sizes for arrow key movement and resizing, replacing the hardcoded 1px. Two new config keys in flameshot.ini: - arrowMoveStep (1-200, default 1): pixels per arrow key press - arrowResizeStep (1-200, default 1): pixels per shift+arrow press Both are also exposed in the GUI settings (General tab) as spinboxes. Default value of 1 preserves existing behavior. Closes flameshot-org#3570
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arrowMoveStepandarrowResizeStep) that control how many pixels each arrow key press moves/resizes the selection1preserves existing behavior — fully backwards compatibleMotivation
The selection widget currently uses hardcoded 1px steps for arrow key movement and resizing. On modern high-resolution displays, this makes keyboard-driven region selection impractical — you'd need hundreds of key presses to move a selection across the screen.
This addresses the keyboard-only workflow requested in #3570. While it doesn't add full keyboard-only region creation, it makes the arrow key adjustment significantly more usable by letting users configure their preferred step size.
Changes
src/utils/confighandler.cpparrowMoveStepandarrowResizeStepasBoundedInt(1, 200, 1)src/utils/confighandler.hsrc/widgets/capture/selectionwidget.hm_moveStepandm_resizeStepmemberssrc/widgets/capture/selectionwidget.cppsrc/config/generalconf.hsrc/config/generalconf.cppflameshot.example.iniUsage
In
flameshot.ini:Or via the GUI: Settings → General → "Arrow move step (px)" / "Arrow resize step (px)"
Test plan
arrowMoveStep=10makes arrow keys move selection by 10pxarrowResizeStep=20makes Shift+arrow resize by 20pxCloses #3570