Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Boxer/BXSession+BXUIControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ typedef NS_ENUM(NSInteger, BXPlaybackMode) {
- (IBAction) mountNextDrivesInQueues: (id)sender;
- (IBAction) mountPreviousDrivesInQueues: (id)sender;

/// Cycle all mounted drives to their next queued images. Triggered by Cmd+F4 keyboard shortcut.
- (IBAction) cycleMountedDiscsForward: (id)sender;

/// Whether we have any drive queues that can be cycled. Used for UI bindings.
- (BOOL) canCycleDrivesInQueues;

Expand Down
30 changes: 30 additions & 0 deletions Boxer/BXSession+BXUIControls.m
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,36 @@ - (IBAction) mountPreviousDrivesInQueues: (id)sender
[self _mountQueuedSiblingsAtOffset: -1];
}

- (IBAction) cycleMountedDiscsForward: (id)sender
{
//Cycle through each mounted drive's queued images, showing bezel notifications for each change.
//This is triggered by Cmd+F4 in the keyboard input handler.
for (BXDrive *currentDrive in self.mountedDrives)
{
BXDrive *siblingDrive = [self siblingOfQueuedDrive: currentDrive atOffset: 1];
if (siblingDrive && ![siblingDrive isEqual: currentDrive])
{
NSError *mountError = nil;
BXDrive *mountedDrive = [self mountDrive: siblingDrive
ifExists: BXDriveReplace
options: BXDefaultDriveMountOptions
error: &mountError];

if (!mountedDrive && mountError)
{
[self presentError: mountError
modalForWindow: self.windowForDriveSheet
delegate: nil
didPresentSelector: NULL
contextInfo: NULL];

//Don't continue mounting if we encounter a problem
break;
}
}
}
}

+ (NSSet *) keyPathsForValuesAffectingCanCycleDrivesInQueues
{
return [NSSet setWithObject: @"drives"];
Expand Down
12 changes: 12 additions & 0 deletions Boxer/DOS window/BXInputController+BXKeyboardInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ - (void) _syncKeyboardLayout

- (void) keyDown: (NSEvent *)theEvent
{
//Special handling for Cmd+F4 to cycle through mounted disc images
if ((theEvent.modifierFlags & NSEventModifierFlagCommand) == NSEventModifierFlagCommand &&
theEvent.keyCode == kVK_F4)
{
[self cycleMountedDiscsForward: self];
return;
}

//If the keypress was command-modified, don't pass it on to the emulator as it indicates
//a failed key equivalent.
//(This is consistent with how other OS X apps with textinput handle Cmd-keypresses.)
Expand Down Expand Up @@ -230,6 +238,10 @@ - (IBAction) sendForwardSlash: (id)sender { [self.representedObject.emulator ha
- (IBAction) sendColon: (id)sender { [self.representedObject.emulator handlePastedString: @":" asCommand: NO]; }
- (IBAction) sendDash: (id)sender { [self.representedObject.emulator handlePastedString: @"-" asCommand: NO]; }

- (IBAction) cycleMountedDiscsForward: (id)sender
{
[self.representedObject cycleMountedDiscsForward: sender];
}

- (void) type: (NSString *)message
{
Expand Down
Loading