Skip to content

feat: configurable arrow key step size for selection widget#4662

Open
AnveshJarabani wants to merge 1 commit into
flameshot-org:masterfrom
AnveshJarabani:feat/configurable-arrow-step
Open

feat: configurable arrow key step size for selection widget#4662
AnveshJarabani wants to merge 1 commit into
flameshot-org:masterfrom
AnveshJarabani:feat/configurable-arrow-step

Conversation

@AnveshJarabani

Copy link
Copy Markdown

Summary

  • Adds two new config keys (arrowMoveStep and arrowResizeStep) that control how many pixels each arrow key press moves/resizes the selection
  • Both exposed in the GUI settings (General tab) as spinboxes with range 1-200
  • Default value of 1 preserves existing behavior — fully backwards compatible

Motivation

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

File Change
src/utils/confighandler.cpp Register arrowMoveStep and arrowResizeStep as BoundedInt(1, 200, 1)
src/utils/confighandler.h Add getter/setter macros
src/widgets/capture/selectionwidget.h Add m_moveStep and m_resizeStep members
src/widgets/capture/selectionwidget.cpp Load step sizes from config, use in all 12 move/resize/symResize methods
src/config/generalconf.h Declare spinbox widgets and slots
src/config/generalconf.cpp Add spinbox UI in General tab with tooltips
flameshot.example.ini Document new keys

Usage

In flameshot.ini:

[General]
arrowMoveStep=10
arrowResizeStep=5

Or via the GUI: Settings → General → "Arrow move step (px)" / "Arrow resize step (px)"

Test plan

  • Default values (1) preserve existing 1px behavior
  • Setting arrowMoveStep=10 makes arrow keys move selection by 10px
  • Setting arrowResizeStep=20 makes Shift+arrow resize by 20px
  • GUI spinboxes read and write values correctly
  • Values persist across restarts
  • Boundary clamping works (selection doesn't go off-screen)
  • Minimum selection size (1x1) is still enforced

Closes #3570

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
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 this pull request may close these issues.

Allow taking interactive screenshots using only keyboard (flameshot gui)

1 participant