From 6fb1c7b0e903e9a6dd61dc9a4e12ded4e397f88b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Dec 2007 21:31:26 +0000 Subject: [PATCH] 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 | 3 +++ src/video/quartz/SDL_QuartzVideo.m | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs.html b/docs.html index 83c068558..d2c50aaa4 100644 --- a/docs.html +++ b/docs.html @@ -79,6 +79,9 @@

Mac OS X Notes

Fixed high frequency crash involving text input.

+

+ Fixed beeping when the escape key is pressed and UNICODE translation is enabled. +

Improved trackpad scrolling support.

diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index c6f582cee..3aff6e894 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -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 (); @@ -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;