annotate src/video/uikit/SDL_uikitview.m @ 2450:96124abbcede gsoc2008_iphone

Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Sat, 16 Aug 2008 00:16:32 +0000
parents 491958a6c881
children
rev   line source
2403
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
1 /*
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
2 SDL - Simple DirectMedia Layer
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
4
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
5 This library is free software; you can redistribute it and/or
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
6 modify it under the terms of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
7 License as published by the Free Software Foundation; either
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
9
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
10 This library is distributed in the hope that it will be useful,
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
13 Lesser General Public License for more details.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
14
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
15 You should have received a copy of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
16 License along with this library; if not, write to the Free Software
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
18
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
19 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
20 slouken@libsdl.org
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
21 */
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
22
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23 #import "SDL_uikitview.h"
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
24
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
25 #if SDL_IPHONE_KEYBOARD
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
26 #import "SDL_keyboard_c.h"
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
27 #import "keyinfotable.h"
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
28 #import "SDL_uikitappdelegate.h"
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
29 #import "SDL_uikitwindow.h"
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
30 #endif
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32 @implementation SDL_uikitview
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34 - (void)dealloc {
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
35 #if SDL_IPHONE_KEYBOARD
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
36 SDL_DelKeyboard(0);
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
37 [textField release];
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
38 #endif
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 [super dealloc];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42 - (id)initWithFrame:(CGRect)frame {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44 self = [super initWithFrame: frame];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
46 #if SDL_IPHONE_KEYBOARD
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
47 [self initializeKeyboard];
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
48 #endif
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
49
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50 int i;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 mice[i].driverdata = NULL;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 SDL_AddMouse(&(mice[i]), i);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 self.multipleTouchEnabled = YES;
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
56
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57 return self;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 NSEnumerator *enumerator = [touches objectEnumerator];
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
64 UITouch *touch =(UITouch*)[enumerator nextObject];
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
65
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
66 /* associate touches with mice, so long as we have slots */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
67 int i;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
68 int found = 0;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
69 for(i=0; touch && i < MAX_SIMULTANEOUS_TOUCHES; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
70
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
71 /* check if this mouse is already tracking a touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
72 if (mice[i].driverdata != NULL) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
73 continue;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
74 }
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
75 /*
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
76 mouse not associated with anything right now,
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
77 associate the touch with this mouse
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
78 */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
79 found = 1;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
80
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
81 /* save old mouse so we can switch back */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
82 int oldMouse = SDL_SelectMouse(-1);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
83
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
84 /* select this slot's mouse */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
85 SDL_SelectMouse(i);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
86 CGPoint locationInView = [touch locationInView: self];
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
87
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
88 /* set driver data to touch object, we'll use touch object later */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
89 mice[i].driverdata = [touch retain];
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
90
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
91 /* send moved event */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
92 SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
93
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
94 /* send mouse down event */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
95 SDL_SendMouseButton(i, SDL_PRESSED, SDL_BUTTON_LEFT);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
96
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
97 /* re-calibrate relative mouse motion */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
98 SDL_GetRelativeMouseState(NULL, NULL);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
99
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
100 /* grab next touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
101 touch = (UITouch*)[enumerator nextObject];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
102
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
103 /* switch back to our old mouse */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
104 SDL_SelectMouse(oldMouse);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
105
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
106 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
107 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
108
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
109 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
110
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
111 NSEnumerator *enumerator = [touches objectEnumerator];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
112 UITouch *touch=nil;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
113
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
114 while(touch = (UITouch *)[enumerator nextObject]) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
115 /* search for the mouse slot associated with this touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
116 int i, found = NO;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
117 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
118 if (mice[i].driverdata == touch) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
119 /* found the mouse associate with the touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
120 [(UITouch*)(mice[i].driverdata) release];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
121 mice[i].driverdata = NULL;
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
122 /* send mouse up */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
123 SDL_SendMouseButton(i, SDL_RELEASED, SDL_BUTTON_LEFT);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
124 /* discontinue search for this touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
125 found = YES;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
126 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
127 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
128 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
129 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
130
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
131 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
132 /*
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
133 this can happen if the user puts more than 5 touches on the screen
2405
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
134 at once, or perhaps in other circumstances. Usually (it seems)
3d0b3a7d3bea Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2403
diff changeset
135 all active touches are canceled.
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
136 */
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
137 [self touchesEnded: touches withEvent: event];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
138 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
139
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
140 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
141
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
142 NSEnumerator *enumerator = [touches objectEnumerator];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
143 UITouch *touch=nil;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
144
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
145 while(touch = (UITouch *)[enumerator nextObject]) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
146 /* try to find the mouse associated with this touch */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
147 int i, found = NO;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
148 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
149 if (mice[i].driverdata == touch) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
150 /* found proper mouse */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
151 CGPoint locationInView = [touch locationInView: self];
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
152 /* send moved event */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
153 SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y);
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
154 /* discontinue search */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
155 found = YES;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
156 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
157 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
158 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
159 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
160
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
161 /*
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
162 ---- Keyboard related functionality below this line ----
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
163 */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
164 #if SDL_IPHONE_KEYBOARD
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
165
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
166 /* Is the iPhone virtual keyboard visible onscreen? */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
167 - (BOOL)keyboardVisible {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
168 return keyboardVisible;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
169 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
170
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
171 /* Set ourselves up as a UITextFieldDelegate */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
172 - (void)initializeKeyboard {
2425
491958a6c881 Removed log messages (printf and NSLog)
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2419
diff changeset
173
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
174 textField = [[[UITextField alloc] initWithFrame: CGRectZero] autorelease];
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
175 textField.delegate = self;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
176 /* placeholder so there is something to delete! */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
177 textField.text = @" ";
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
178
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
179 /* set UITextInputTrait properties, mostly to defaults */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
180 textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
181 textField.autocorrectionType = UITextAutocorrectionTypeNo;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
182 textField.enablesReturnKeyAutomatically = NO;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
183 textField.keyboardAppearance = UIKeyboardAppearanceDefault;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
184 textField.keyboardType = UIKeyboardTypeDefault;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
185 textField.returnKeyType = UIReturnKeyDefault;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
186 textField.secureTextEntry = NO;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
187
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
188 textField.hidden = YES;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
189 keyboardVisible = NO;
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
190 /* add the UITextField (hidden) to our view */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
191 [self addSubview: textField];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
192
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
193 /* create our SDL_Keyboard */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
194 SDL_Keyboard keyboard;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
195 SDL_zero(keyboard);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
196 SDL_AddKeyboard(&keyboard, 0);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
197 SDLKey keymap[SDL_NUM_SCANCODES];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
198 SDL_GetDefaultKeymap(keymap);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
199 SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
200
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
201 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
202
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
203 /* reveal onscreen virtual keyboard */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
204 - (void)showKeyboard {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
205 keyboardVisible = YES;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
206 [textField becomeFirstResponder];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
207 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
208
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
209 /* hide onscreen virtual keyboard */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
210 - (void)hideKeyboard {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
211 keyboardVisible = NO;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
212 [textField resignFirstResponder];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
213 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
214
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
215 /* UITextFieldDelegate method. Invoked when user types something. */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
216 - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
217
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
218 if ([string length] == 0) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
219 /* it wants to replace text with nothing, ie a delete */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
220 SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_DELETE);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
221 SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_DELETE);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
222 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
223 else {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
224 /* go through all the characters in the string we've been sent
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
225 and convert them to key presses */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
226 int i;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
227 for (i=0; i<[string length]; i++) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
228
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
229 unichar c = [string characterAtIndex: i];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
230
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
231 Uint16 mod = 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
232 SDL_scancode code;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
233
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
234 if (c < 127) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
235 /* figure out the SDL_scancode and SDL_keymod for this unichar */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
236 code = unicharToUIKeyInfoTable[c].code;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
237 mod = unicharToUIKeyInfoTable[c].mod;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
238 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
239 else {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
240 /* we only deal with ASCII right now */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
241 code = SDL_SCANCODE_UNKNOWN;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
242 mod = 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
243 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
244
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
245 if (mod & KMOD_SHIFT) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
246 /* If character uses shift, press shift down */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
247 SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_LSHIFT);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
248 }
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
249 /* send a keydown and keyup even for the character */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
250 SDL_SendKeyboardKey( 0, SDL_PRESSED, code);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
251 SDL_SendKeyboardKey( 0, SDL_RELEASED, code);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
252 if (mod & KMOD_SHIFT) {
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
253 /* If character uses shift, press shift back up */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
254 SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_LSHIFT);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
255 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
256 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
257 }
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
258 return NO; /* don't allow the edit! (keep placeholder text there) */
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
259 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
260
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
261 /* Terminates the editing session */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
262 - (BOOL)textFieldShouldReturn:(UITextField*)_textField {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
263 [self hideKeyboard];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
264 return YES;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
265 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
266
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
267 #endif
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
268
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
269 @end
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
270
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
271 /* iPhone keyboard addition functions */
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
272 #if SDL_IPHONE_KEYBOARD
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
273
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
274 int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
275
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
276 SDL_Window *window = SDL_GetWindowFromID(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
277 SDL_WindowData *data;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
278 SDL_uikitview *view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
279
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
280 if (NULL == window) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
281 SDL_SetError("Window does not exist");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
282 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
283 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
284
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
285 data = (SDL_WindowData *)window->driverdata;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
286 view = data->view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
287
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
288 if (nil == view) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
289 SDL_SetError("Window has no view");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
290 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
291 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
292 else {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
293 [view showKeyboard];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
294 return 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
295 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
296 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
297
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
298 int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
299
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
300 SDL_Window *window = SDL_GetWindowFromID(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
301 SDL_WindowData *data;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
302 SDL_uikitview *view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
303
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
304 if (NULL == window) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
305 SDL_SetError("Window does not exist");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
306 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
307 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
308
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
309 data = (SDL_WindowData *)window->driverdata;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
310 view = data->view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
311
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
312 if (NULL == view) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
313 SDL_SetError("Window has no view");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
314 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
315 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
316 else {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
317 [view hideKeyboard];
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
318 return 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
319 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
320 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
321
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
322 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
323
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
324 SDL_Window *window = SDL_GetWindowFromID(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
325 SDL_WindowData *data;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
326 SDL_uikitview *view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
327
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
328 if (NULL == window) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
329 SDL_SetError("Window does not exist");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
330 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
331 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
332
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
333 data = (SDL_WindowData *)window->driverdata;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
334 view = data->view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
335
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
336 if (NULL == view) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
337 SDL_SetError("Window has no view");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
338 return 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
339 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
340 else {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
341 return view.keyboardVisible;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
342 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
343 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
344
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
345 int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
346
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
347 SDL_Window *window = SDL_GetWindowFromID(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
348 SDL_WindowData *data;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
349 SDL_uikitview *view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
350
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
351 if (NULL == window) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
352 SDL_SetError("Window does not exist");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
353 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
354 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
355
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
356 data = (SDL_WindowData *)window->driverdata;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
357 view = data->view;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
358
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
359 if (NULL == view) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
360 SDL_SetError("Window has no view");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
361 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
362 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
363 else {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
364 if (SDL_iPhoneKeyboardIsShown(windowID)) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
365 SDL_iPhoneKeyboardHide(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
366 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
367 else {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
368 SDL_iPhoneKeyboardShow(windowID);
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
369 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
370 return 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
371 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
372 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
373
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
374 #else
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
375
2450
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
376 /* stubs, used if compiled without keyboard support */
96124abbcede Added comments, view now deletes keyboard upon dealloc, function declarations for iPhone keyboard additions now moved to SDL_uikitkeyboard.h.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2425
diff changeset
377
2419
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
378 int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
379 SDL_SetError("Not compiled with keyboard support");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
380 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
381 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
382
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
383 int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
384 SDL_SetError("Not compiled with keyboard support");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
385 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
386 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
387
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
388 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
389 return 0;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
390 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
391
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
392 int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) {
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
393 SDL_SetError("Not compiled with keyboard support");
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
394 return -1;
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
395 }
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
396
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
397
ab89ff6e97af Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2405
diff changeset
398 #endif /* SDL_IPHONE_KEYBOARD */