Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Added keyboard support in view initialization and proper deallocation…
… of keyboard in -(void)dealloc, if keyboard is enabled
  • Loading branch information
Holmes Futrell committed Jul 29, 2008
1 parent d3020c1 commit 88b2d16
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/video/uikit/SDL_uikitview.m
Expand Up @@ -19,25 +19,34 @@
Sam Lantinga
slouken@libsdl.org
*/

#import "SDL_uikitview.h"
#import "SDL_uikitkeyboard.h"

@implementation SDL_uikitview

- (void)dealloc {
#if SDL_IPHONE_KEYBOARD
[textField release];
#endif
[super dealloc];
}

- (id)initWithFrame:(CGRect)frame {

self = [super initWithFrame: frame];

#if SDL_IPHONE_KEYBOARD
[self initializeKeyboard];
#endif

int i;
for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
mice[i].driverdata = NULL;
SDL_AddMouse(&(mice[i]), i);
}
self.multipleTouchEnabled = YES;

return self;

}
Expand Down Expand Up @@ -95,8 +104,8 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
/*
this can happen if the user puts more than 5 touches on the screen
at once, or perhaps in other circumstances. Usually all active
touches are canceled.
at once, or perhaps in other circumstances. Usually (it seems)
all active touches are canceled.
*/
[self touchesEnded: touches withEvent: event];
}
Expand All @@ -118,4 +127,6 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
}



@end

0 comments on commit 88b2d16

Please sign in to comment.