Fixed a bug in the Cocoa port that made SameBoy ignore some input keys when the keyboard layout is set to a non-Latin/ASCII keyboard. This was solved by forcing an ASCII layout.
This commit is contained in:
parent
94ea44da0c
commit
c27ee9d879
@ -1,4 +1,5 @@
|
|||||||
#import <OpenGL/gl.h>
|
#import <OpenGL/gl.h>
|
||||||
|
#import <Carbon/Carbon.h>
|
||||||
#import "GBView.h"
|
#import "GBView.h"
|
||||||
#import "GBButtons.h"
|
#import "GBButtons.h"
|
||||||
#import "NSString+StringForKey.h"
|
#import "NSString+StringForKey.h"
|
||||||
@ -152,6 +153,27 @@ static GBShader *shader = nil;
|
|||||||
glViewport(0, 0, self.bounds.size.width * scale, self.bounds.size.height * scale);
|
glViewport(0, 0, self.bounds.size.width * scale, self.bounds.size.height * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)becomeFirstResponder
|
||||||
|
{
|
||||||
|
/* Non-Roman keyboard layouts breaks user input. */
|
||||||
|
TSMDocumentID document = TSMGetActiveDocument();
|
||||||
|
|
||||||
|
CFArrayRef inpu_sources = TISCreateASCIICapableInputSourceList();
|
||||||
|
TSMSetDocumentProperty(document, kTSMDocumentEnabledInputSourcesPropertyTag,
|
||||||
|
sizeof(CFArrayRef), &inpu_sources);
|
||||||
|
CFRelease(inpu_sources);
|
||||||
|
|
||||||
|
return [super becomeFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)resignFirstResponder
|
||||||
|
{
|
||||||
|
TSMDocumentID document = TSMGetActiveDocument();
|
||||||
|
TSMRemoveDocumentProperty(document, kTSMDocumentEnabledInputSourcesPropertyTag);
|
||||||
|
|
||||||
|
return [super resignFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)acceptsFirstResponder
|
- (BOOL)acceptsFirstResponder
|
||||||
{
|
{
|
||||||
return YES;
|
return YES;
|
||||||
|
Loading…
Reference in New Issue
Block a user