Use arrow keys to resize rectangle precisely pixel by pixel

I am drawing a big rectangle and I need to reach a specific size to fit constraints (e.g. match a game screen). I can use mouse drag for an approximation, but I’d like to be able to use the arrow keys to get the exact dimension I need, similarly to how screenshot apps work.

I tried to press Space+arrow keys to scroll the view itself by 1px (Using the keys to navigate the pixel grid) but it doesn’t work while holding the mouse to draw a rectangle. There is no shortcut to move the cursor itself either (Drawing pixel art with arrow keys instead of the mouse).

There is no way to pre-enter a rectangle dimension numerically either (would be the best for my specific case, but wouldn’t solve cases where the user is drawing a bounding box around something by eye and doesn’t know the exact dimensions beforehand).

So being able to press (remappable?) arrow keys while drawing the rectangle to move the final corner (probably along with the cursor to avoid desync/offset between rectangle corner and cursor position) would be very useful.

Bonus point if shift+arrow keys move by a grid unit, like the Move tool.