~ubuntu-branches/ubuntu/karmic/libsdl1.2/karmic

« back to all changes in this revision

Viewing changes to src/video/quartz/SDL_QuartzEvents.m

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2008-01-05 14:10:45 UTC
  • mto: (2.1.3 lenny)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080105141045-mjdg2rp09mamme4a
Tags: upstream-1.2.13
ImportĀ upstreamĀ versionĀ 1.2.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
 
255
255
static void QZ_DoKey (_THIS, int state, NSEvent *event) {
256
256
 
257
 
    NSString *chars;
 
257
    NSString *chars = NULL;
258
258
    unsigned int i, numChars;
259
259
    SDL_keysym key;
260
260
    
270
270
        [field_edit interpretKeyEvents:[NSArray arrayWithObject:event]];
271
271
        chars = [ event characters ];
272
272
        numChars = [ chars length ];
 
273
        if (numChars > 0)
 
274
            [field_edit setString:@""];
273
275
    } else {
274
276
        numChars = 0;
275
277
    }
928
930
                        Uint8 button;
929
931
                        dy = [ event deltaY ];
930
932
                        dx = [ event deltaX ];
931
 
                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
 
933
                        if ( dy > 0.0 ) /* Scroll up */
932
934
                            button = SDL_BUTTON_WHEELUP;
933
 
                        else /* Scroll down */
 
935
                        else if ( dy < 0.0 ) /* Scroll down */
934
936
                            button = SDL_BUTTON_WHEELDOWN;
 
937
                        else
 
938
                            break; /* Horizontal scroll */
935
939
                        /* For now, wheel is sent as a quick down+up */
936
940
                        SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
937
941
                        SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);