Skip to content

Commit

Permalink
Guillaume Borios fixed bug #508
Browse files Browse the repository at this point in the history
When unicode translation is ON, pressing the escape key raise an NSBeep()
because the NSTextView interprets the key as a special command (in that case
impossible to interpret)... The NSTextView instance should replaced by
something subclassed so that doCommandBySelector: does nothing.

Example code :

@interface SDLTranslatorResponder : NSTextView
{
}
- (void) doCommandBySelector:(SEL)myselector;
@EnD

@implementation SDLTranslatorResponder
- (void) doCommandBySelector:(SEL) myselector {}
@EnD
  • Loading branch information
slouken committed Dec 29, 2007
1 parent 902bf19 commit 6fb1c7b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs.html
Expand Up @@ -79,6 +79,9 @@ <H3> Mac OS X Notes </H3>
<P>
Fixed high frequency crash involving text input.
</P>
<P>
Fixed beeping when the escape key is pressed and UNICODE translation is enabled.
</P>
<P>
Improved trackpad scrolling support.
</P>
Expand Down
12 changes: 11 additions & 1 deletion src/video/quartz/SDL_QuartzVideo.m
Expand Up @@ -42,6 +42,16 @@ - (void) setFrame:(NSRect)frame;
}
@end

@interface SDLTranslatorResponder : NSTextView
{
}
- (void) doCommandBySelector:(SEL)myselector;
@end

@implementation SDLTranslatorResponder
- (void) doCommandBySelector:(SEL) myselector {}
@end


/* Bootstrap functions */
static int QZ_Available ();
Expand Down Expand Up @@ -203,7 +213,7 @@ static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format) {
cursor_should_be_visible = YES;
cursor_visible = YES;
current_mods = 0;
field_edit = [[NSTextView alloc] initWithFrame:r];
field_edit = [[SDLTranslatorResponder alloc] initWithFrame:r];

if ( Gestalt(gestaltSystemVersion, &system_version) != noErr )
system_version = 0;
Expand Down

0 comments on commit 6fb1c7b

Please sign in to comment.