- 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.
Here is a patch for this. Don't know if it can be done better. Mark
... // 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];
if ([event keyCode] == 51 || [event keyCode] == 117) { // Delete keys (back and forward) [self clearOverlay];
... File Added: SWPaintView.m
move selection -- based on V2.0 src
Add keyboard short cuts for selection tool palette tools (s- selection, E- erase, i = eye dropper, t - text, b - brush)
File Added: SWToolboxController.m
Log in to post a comment.
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
move selection -- based on V2.0 src
Add keyboard short cuts for selection tool palette tools (s- selection, E- erase, i = eye dropper, t - text, b - brush)
File Added: SWToolboxController.m