Skip to content

Commit

Permalink
oops, missed a file
Browse files Browse the repository at this point in the history
  • Loading branch information
sh95014 committed Dec 21, 2023
1 parent fef2240 commit cbff2e9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions source/frontends/mariani/EmulatorView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#import "EmulatorView.h"
#import "Carbon/Carbon.h"
#import "UserDefaults.h"

#import "linux/keyboardbuffer.h"
#import "linux/paddle.h"

Expand Down Expand Up @@ -103,6 +105,21 @@ - (void)keyDown:(NSEvent *)event {
case kVK_Tab:
ch = ASCII_HT;
break;
case kVK_ANSI_Keypad0: // fallthrough
case kVK_ANSI_Keypad1: // fallthrough
case kVK_ANSI_Keypad2: // fallthrough
case kVK_ANSI_Keypad3: // fallthrough
case kVK_ANSI_Keypad4: // fallthrough
case kVK_ANSI_Keypad6: // fallthrough
case kVK_ANSI_Keypad7: // fallthrough
case kVK_ANSI_Keypad8: // fallthrough
case kVK_ANSI_Keypad9: { // fallthrough
if ([[UserDefaults sharedInstance].gameController isEqualToString:GameControllerNumericKeypad]) {
[self.numericKeyDelegate emulatorView:self numericKeyDown:[event.charactersIgnoringModifiers characterAtIndex:0]];
return;
}
// fallthrough
}
default: {
unichar raw = [event.charactersIgnoringModifiers characterAtIndex:0];
if (event.modifierFlags & NSEventModifierFlagControl) {
Expand Down Expand Up @@ -150,6 +167,25 @@ - (void)keyDown:(NSEvent *)event {
}
}

- (void)keyUp:(NSEvent *)event {
switch (event.keyCode) {
case kVK_ANSI_Keypad0: // fallthrough
case kVK_ANSI_Keypad1: // fallthrough
case kVK_ANSI_Keypad2: // fallthrough
case kVK_ANSI_Keypad3: // fallthrough
case kVK_ANSI_Keypad4: // fallthrough
case kVK_ANSI_Keypad6: // fallthrough
case kVK_ANSI_Keypad7: // fallthrough
case kVK_ANSI_Keypad8: // fallthrough
case kVK_ANSI_Keypad9: { // fallthrough
if ([[UserDefaults sharedInstance].gameController isEqualToString:GameControllerNumericKeypad]) {
[self.numericKeyDelegate emulatorView:self numericKeyUp:[event.charactersIgnoringModifiers characterAtIndex:0]];
}
break;
}
}
}

- (void)flagsChanged:(NSEvent *)event
{
switch (event.keyCode) {
Expand Down

0 comments on commit cbff2e9

Please sign in to comment.