Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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 88b2d16e22639ef2386af0c7a2039a3f070bc7ee
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/video/uikit/SDL_uikitview.m
@@ -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;

}
@@ -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];
}
@@ -118,4 +127,6 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
}



@end

0 comments on commit 88b2d16

Please sign in to comment.