Menu

#5 option to move selection with keyboard arrows

open
nobody
None
5
2008-11-14
2008-11-14
RM Fleming
No

- I like to use keyboard to move current selection around after i paste something on top.

- also the cursor should change to a Hand when pointing at selection if it's dragging an image.

Discussion

  • RM Fleming

    RM Fleming - 2009-02-07

    Here is a patch for this. Don't know if it can be done better.
    Mark

    SWPaintView.m

    ...
    // Handles keyboard events
    - (void)keyDown:(NSEvent *)event
    {
    // Escape key
    if ([event keyCode] == 53) {
    isPayingAttention = NO;
    [currentTool tieUpLooseEnds];
    SWClearImage(secondImage);
    [self setNeedsDisplay:YES];

    } else

    if ( ([[currentTool class] isEqualTo:[SWSelectionTool class]] &&
    [(SWSelectionTool *)currentTool isSelected])) {

    [self updateCurrentTool];
    // setup starting point...
    [currentTool performDrawAtPoint:currentPoint
    withMainImage:mainImage
    secondImage:secondImage
    mouseEvent:MOUSE_DOWN];

    // NSLog(@"[event keyCode] %d", [event keyCode]);
    if ([event keyCode] == 125 || [event keyCode] == 126) // drag using arrow keys (up/down)
    currentPoint.y += (([event keyCode] == 126) ? 1 : -1);
    if ([event keyCode] == 123 || [event keyCode] == 124) // drag using arrow keys (Left / right)
    currentPoint.x += (([event keyCode] == 124) ? 1 : -1);

    [currentTool performDrawAtPoint:currentPoint
    withMainImage:mainImage
    secondImage:secondImage
    mouseEvent:MOUSE_DRAGGED];

    } else

    if ([event keyCode] == 51 || [event keyCode] == 117) {
    // Delete keys (back and forward)
    [self clearOverlay];

    ...
    File Added: SWPaintView.m

     
  • RM Fleming

    RM Fleming - 2009-02-07

    move selection -- based on V2.0 src

     
  • RM Fleming

    RM Fleming - 2009-02-07

    Add keyboard short cuts for selection tool palette tools (s- selection, E- erase, i = eye dropper, t - text, b - brush)

     
  • RM Fleming

    RM Fleming - 2009-02-07

    File Added: SWToolboxController.m

     

Log in to post a comment.