mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-26 17:32:40 +00:00
Misc tweaks
* intercept application terminate and eject disks * closing last window terminates app * send scancodes for control keys
This commit is contained in:
parent
2f884cf129
commit
21660fdcb9
@ -299,4 +299,20 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Application Delegate methods
|
||||
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)application
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)application
|
||||
{
|
||||
c_eject_6(0);
|
||||
c_eject_6(1);
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -183,8 +183,6 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
NSLog(@"keyCode : %04x", [event keyCode]);
|
||||
}
|
||||
|
||||
- (void)_handleKeyEvent:(NSEvent *)event pressed:(BOOL)pressed
|
||||
@ -192,14 +190,11 @@
|
||||
unichar c = [[event charactersIgnoringModifiers] characterAtIndex:0];
|
||||
int scode = (int)c;
|
||||
|
||||
NSLog(@"key = %08x", c);
|
||||
|
||||
int cooked = 0;
|
||||
switch (scode)
|
||||
{
|
||||
case 0x1b:
|
||||
scode = SCODE_ESC;
|
||||
NSLog(@"ESC...");
|
||||
break;
|
||||
|
||||
case NSUpArrowFunctionKey:
|
||||
@ -209,7 +204,6 @@
|
||||
scode = SCODE_D;
|
||||
break;
|
||||
case NSLeftArrowFunctionKey:
|
||||
NSLog(@"LEFT ARROW");
|
||||
scode = SCODE_L;
|
||||
break;
|
||||
case NSRightArrowFunctionKey:
|
||||
@ -284,7 +278,15 @@
|
||||
break;
|
||||
|
||||
default:
|
||||
cooked = 1;
|
||||
if ([event modifierFlags] & NSControlKeyMask)
|
||||
{
|
||||
scode = c_keys_ascii_to_scancode(scode);
|
||||
cooked = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cooked = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user