Guillaume Borios fixed bug #508 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 21:31:26 +0000
branchSDL-1.2
changeset 41239d90d7765fa7
parent 4122 cb7b118b400a
child 4124 df2f562890a0
Guillaume Borios fixed bug #508

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
docs.html
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/docs.html	Sat Dec 29 20:28:21 2007 +0000
     1.2 +++ b/docs.html	Sat Dec 29 21:31:26 2007 +0000
     1.3 @@ -80,6 +80,9 @@
     1.4  	Fixed high frequency crash involving text input.
     1.5  </P>
     1.6  <P>
     1.7 +	Fixed beeping when the escape key is pressed and UNICODE translation is enabled.
     1.8 +</P>
     1.9 +<P>
    1.10  	Improved trackpad scrolling support.
    1.11  </P>
    1.12  <P>
     2.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Sat Dec 29 20:28:21 2007 +0000
     2.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Sat Dec 29 21:31:26 2007 +0000
     2.3 @@ -42,6 +42,16 @@
     2.4  }
     2.5  @end
     2.6  
     2.7 +@interface SDLTranslatorResponder : NSTextView
     2.8 +{
     2.9 +}
    2.10 +- (void) doCommandBySelector:(SEL)myselector;
    2.11 +@end
    2.12 +
    2.13 +@implementation SDLTranslatorResponder
    2.14 +- (void) doCommandBySelector:(SEL) myselector {}
    2.15 +@end
    2.16 +
    2.17  
    2.18  /* Bootstrap functions */
    2.19  static int              QZ_Available ();
    2.20 @@ -203,7 +213,7 @@
    2.21      cursor_should_be_visible    = YES;
    2.22      cursor_visible              = YES;
    2.23      current_mods = 0;
    2.24 -    field_edit =  [[NSTextView alloc] initWithFrame:r];
    2.25 +    field_edit =  [[SDLTranslatorResponder alloc] initWithFrame:r];
    2.26      
    2.27      if ( Gestalt(gestaltSystemVersion, &system_version) != noErr )
    2.28          system_version = 0;