2688
|
1 |
/*
|
|
2 |
SDL - Simple DirectMedia Layer
|
|
3 |
Copyright (C) 1997-2009 Sam Lantinga
|
|
4 |
|
|
5 |
This library is free software; you can redistribute it and/or
|
|
6 |
modify it under the terms of the GNU Lesser General Public
|
|
7 |
License as published by the Free Software Foundation; either
|
|
8 |
version 2.1 of the License, or (at your option) any later version.
|
|
9 |
|
|
10 |
This library is distributed in the hope that it will be useful,
|
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13 |
Lesser General Public License for more details.
|
|
14 |
|
|
15 |
You should have received a copy of the GNU Lesser General Public
|
|
16 |
License along with this library; if not, write to the Free Software
|
|
17 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
|
|
19 |
Sam Lantinga, mods for Hedgewars by Vittorio Giovara
|
|
20 |
slouken@libsdl.org, vittorio.giovara@gmail.com
|
|
21 |
*/
|
|
22 |
|
|
23 |
#include "PascalImports.h"
|
|
24 |
#import "SDL_uikitview.h"
|
|
25 |
#import "SDL_uikitappdelegate.h"
|
|
26 |
|
|
27 |
#if SDL_IPHONE_KEYBOARD
|
|
28 |
#import "SDL_keyboard_c.h"
|
|
29 |
#import "keyinfotable.h"
|
|
30 |
#import "SDL_uikitwindow.h"
|
|
31 |
#endif
|
|
32 |
|
|
33 |
@implementation SDL_uikitview
|
|
34 |
|
|
35 |
@synthesize initialDistance, gestureStartPoint;
|
|
36 |
|
2689
|
37 |
// they have to be global variables to allow showControls() to use them
|
|
38 |
UIButton *attackButton, *menuButton;
|
|
39 |
|
2688
|
40 |
- (void)dealloc {
|
|
41 |
#if SDL_IPHONE_KEYBOARD
|
|
42 |
SDL_DelKeyboard(0);
|
|
43 |
[textField release];
|
|
44 |
#endif
|
2689
|
45 |
[menuButton release];
|
|
46 |
[attackButton release];
|
2688
|
47 |
[super dealloc];
|
|
48 |
}
|
|
49 |
|
|
50 |
- (id)initWithFrame:(CGRect)frame {
|
2689
|
51 |
// the addTarget parameter for the buttons below is set like that because
|
|
52 |
// this object is inherited by SDL_openglesview.m which is the one allocated by SDL.
|
|
53 |
// We select this class with [self superclass] and call the selectors with "+" because
|
|
54 |
// they are superclass methods
|
2688
|
55 |
self = [super initWithFrame: frame];
|
|
56 |
|
|
57 |
#if SDL_IPHONE_KEYBOARD
|
|
58 |
[self initializeKeyboard];
|
|
59 |
#endif
|
|
60 |
|
|
61 |
int i;
|
|
62 |
for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
|
|
63 |
mice[i].id = i;
|
|
64 |
mice[i].driverdata = NULL;
|
|
65 |
SDL_AddMouse(&mice[i], "Mouse", 0, 0, 1);
|
|
66 |
}
|
|
67 |
|
2689
|
68 |
attackButton = [[UIButton alloc] initWithFrame:CGRectMake(30, 480, 260,50)];
|
2688
|
69 |
[attackButton setBackgroundImage:[UIImage imageNamed:@"Default.png"] forState:UIControlStateNormal];
|
|
70 |
[attackButton addTarget:[self superclass] action:@selector(attackButtonPressed) forControlEvents:UIControlEventTouchDown];
|
|
71 |
[attackButton addTarget:[self superclass] action:@selector(attackButtonReleased) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
|
2689
|
72 |
[self addSubview:attackButton];
|
|
73 |
|
|
74 |
menuButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 480, 30,50)];
|
|
75 |
[menuButton setBackgroundImage:[UIImage imageNamed:@"Default.png"] forState:UIControlStateNormal];
|
|
76 |
[menuButton addTarget:[self superclass] action:@selector(attackButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
|
77 |
[self addSubview:menuButton];
|
2688
|
78 |
|
|
79 |
self.multipleTouchEnabled = YES;
|
2689
|
80 |
|
2688
|
81 |
return self;
|
|
82 |
}
|
|
83 |
|
|
84 |
#pragma mark -
|
2689
|
85 |
#pragma mark Show and Hide overlaid buttons
|
|
86 |
|
|
87 |
// standard C function to be called from pascal
|
|
88 |
void showControls(void) {
|
|
89 |
NSLog(@"Showing controls");
|
|
90 |
[UIView beginAnimations:nil context:NULL];
|
|
91 |
[UIView setAnimationDuration:0.5];
|
|
92 |
attackButton.frame = CGRectMake(30, 430, 260, 50);
|
|
93 |
menuButton.frame = CGRectMake(0, 430, 30, 50);
|
|
94 |
[UIView commitAnimations];
|
|
95 |
}
|
|
96 |
|
|
97 |
#pragma mark -
|
2688
|
98 |
#pragma mark Superclass methods
|
2689
|
99 |
|
2688
|
100 |
+(void) attackButtonPressed {
|
|
101 |
HW_shoot();
|
|
102 |
}
|
|
103 |
|
|
104 |
+(void) attackButtonReleased {
|
|
105 |
HW_allKeysUp();
|
|
106 |
}
|
|
107 |
|
|
108 |
#pragma mark -
|
|
109 |
#pragma mark Custom SDL_UIView input handling
|
|
110 |
|
|
111 |
// we override default touch input to implement our own gestures
|
|
112 |
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
|
|
113 |
/*NSEnumerator *enumerator = [touches objectEnumerator];
|
|
114 |
UITouch *touch =(UITouch*)[enumerator nextObject];
|
|
115 |
|
|
116 |
/* associate touches with mice, so long as we have slots
|
|
117 |
int i;
|
|
118 |
int found = 0;
|
|
119 |
for(i=0; touch && i < MAX_SIMULTANEOUS_TOUCHES; i++) {
|
|
120 |
|
|
121 |
/* check if this mouse is already tracking a touch
|
|
122 |
if (mice[i].driverdata != NULL) {
|
|
123 |
continue;
|
|
124 |
}
|
|
125 |
/*
|
|
126 |
mouse not associated with anything right now,
|
|
127 |
associate the touch with this mouse
|
|
128 |
|
|
129 |
found = 1;
|
|
130 |
|
|
131 |
/* save old mouse so we can switch back
|
|
132 |
int oldMouse = SDL_SelectMouse(-1);
|
|
133 |
|
|
134 |
/* select this slot's mouse
|
|
135 |
SDL_SelectMouse(i);
|
|
136 |
CGPoint locationInView = [touch locationInView: self];
|
|
137 |
|
|
138 |
/* set driver data to touch object, we'll use touch object later
|
|
139 |
mice[i].driverdata = [touch retain];
|
|
140 |
|
|
141 |
/* send moved event
|
|
142 |
SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y, 0);
|
|
143 |
|
|
144 |
/* send mouse down event
|
|
145 |
SDL_SendMouseButton(i, SDL_PRESSED, SDL_BUTTON_LEFT);
|
|
146 |
|
|
147 |
/* re-calibrate relative mouse motion
|
|
148 |
SDL_GetRelativeMouseState(i, NULL, NULL);
|
|
149 |
|
|
150 |
/* grab next touch
|
|
151 |
touch = (UITouch*)[enumerator nextObject];
|
|
152 |
|
|
153 |
/* switch back to our old mouse
|
|
154 |
SDL_SelectMouse(oldMouse);
|
|
155 |
|
|
156 |
} */
|
|
157 |
|
|
158 |
UITouch *touch = [touches anyObject];
|
|
159 |
gestureStartPoint = [touch locationInView:self];
|
|
160 |
|
|
161 |
// one tap - single click
|
|
162 |
if (1 == [touch tapCount] ) {
|
|
163 |
//SDL_WarpMouseInWindow([SDLUIKitDelegate sharedAppDelegate].windowID, gestureStartPoint.x, gestureStartPoint.y);
|
|
164 |
HW_click();
|
|
165 |
}
|
|
166 |
|
|
167 |
// two taps - right click
|
|
168 |
if (2 == [touch tapCount] ) {
|
|
169 |
HW_ammoMenu();
|
|
170 |
}
|
|
171 |
|
|
172 |
// two taps with two fingers - middle click
|
|
173 |
if (2 == [touch tapCount] && 2 == [touches count]) {
|
|
174 |
HW_zoomReset();
|
|
175 |
}
|
|
176 |
|
|
177 |
// two fingers - begin pinching
|
|
178 |
if (2 == [touches count]) {
|
|
179 |
NSArray *twoTouches = [touches allObjects];
|
|
180 |
UITouch *first = [twoTouches objectAtIndex:0];
|
|
181 |
UITouch *second = [twoTouches objectAtIndex:1];
|
|
182 |
initialDistance = distanceBetweenPoints([first locationInView:self], [second locationInView:self]);
|
|
183 |
}
|
|
184 |
}
|
|
185 |
|
|
186 |
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
|
|
187 |
initialDistance = 0;
|
|
188 |
// NSLog(@"touches ended, sigh");
|
|
189 |
|
|
190 |
HW_allKeysUp();
|
|
191 |
/*NSEnumerator *enumerator = [touches objectEnumerator];
|
|
192 |
UITouch *touch=nil;
|
|
193 |
|
|
194 |
while(touch = (UITouch *)[enumerator nextObject]) {
|
|
195 |
/* search for the mouse slot associated with this touch
|
|
196 |
int i, found = NO;
|
|
197 |
for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
|
|
198 |
if (mice[i].driverdata == touch) {
|
|
199 |
/* found the mouse associate with the touch
|
|
200 |
[(UITouch*)(mice[i].driverdata) release];
|
|
201 |
mice[i].driverdata = NULL;
|
|
202 |
/* send mouse up
|
|
203 |
SDL_SendMouseButton(i, SDL_RELEASED, SDL_BUTTON_LEFT);
|
|
204 |
/* discontinue search for this touch
|
|
205 |
found = YES;
|
|
206 |
}
|
|
207 |
}
|
|
208 |
}*/
|
|
209 |
}
|
|
210 |
|
|
211 |
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
|
|
212 |
/*
|
|
213 |
this can happen if the user puts more than 5 touches on the screen
|
|
214 |
at once, or perhaps in other circumstances. Usually (it seems)
|
|
215 |
all active touches are canceled.
|
|
216 |
*/
|
|
217 |
[self touchesEnded: touches withEvent: event];
|
|
218 |
}
|
|
219 |
|
|
220 |
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
|
|
221 |
UITouch *touch = [touches anyObject];
|
|
222 |
CGPoint currentPosition = [touch locationInView:self];
|
|
223 |
|
|
224 |
CGFloat Xdiff = gestureStartPoint.x - currentPosition.x;
|
|
225 |
CGFloat Ydiff = gestureStartPoint.y - currentPosition.y;
|
|
226 |
CGFloat deltaX = fabsf(Xdiff);
|
|
227 |
CGFloat deltaY = fabsf(Ydiff);
|
|
228 |
|
|
229 |
if (deltaX >= kMinimumGestureLength && deltaY <= kMaximumVariance) {
|
|
230 |
NSLog(@"Horizontal swipe detected, begX:%f curX:%f", gestureStartPoint.x, currentPosition.x);
|
|
231 |
if (Xdiff > 0) HW_walkLeft();
|
|
232 |
else HW_walkRight();
|
|
233 |
}
|
|
234 |
else if (deltaY >= kMinimumGestureLength && deltaX <= kMaximumVariance){
|
|
235 |
NSLog(@"Vertical swipe detected, begY:%f curY:%f", gestureStartPoint.y, currentPosition.y);
|
|
236 |
if (Ydiff > 0) HW_aimUp();
|
|
237 |
else HW_aimDown();
|
|
238 |
}
|
|
239 |
|
|
240 |
// end pinch detection
|
|
241 |
if (2 == [touches count]) {
|
|
242 |
NSArray *twoTouches = [touches allObjects];
|
|
243 |
UITouch *first = [twoTouches objectAtIndex:0];
|
|
244 |
UITouch *second = [twoTouches objectAtIndex:1];
|
|
245 |
CGFloat currentDistance = distanceBetweenPoints([first locationInView:self], [second locationInView:self]);
|
|
246 |
|
|
247 |
if (0 == initialDistance)
|
|
248 |
initialDistance = currentDistance;
|
|
249 |
else if (currentDistance - initialDistance > kMinimumPinchDelta) {
|
|
250 |
NSLog(@"Outward pinch detected");
|
|
251 |
HW_zoomOut();
|
|
252 |
}
|
|
253 |
else if (initialDistance - currentDistance > kMinimumPinchDelta) {
|
|
254 |
NSLog(@"Inward pinch detected");
|
|
255 |
HW_zoomIn();
|
|
256 |
}
|
|
257 |
}
|
|
258 |
|
|
259 |
/*NSEnumerator *enumerator = [touches objectEnumerator];
|
|
260 |
UITouch *touch=nil;while(touch = (UITouch *)[enumerator nextObject]) {
|
|
261 |
// try to find the mouse associated with this touch
|
|
262 |
int i, found = NO;
|
|
263 |
for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
|
|
264 |
if (mice[i].driverdata == touch) {
|
|
265 |
// found proper mouse
|
|
266 |
CGPoint locationInView = [touch locationInView: self];
|
|
267 |
// send moved event
|
|
268 |
SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y, 0);
|
|
269 |
// discontinue search
|
|
270 |
found = YES;
|
|
271 |
}
|
|
272 |
}
|
|
273 |
}*/
|
|
274 |
}
|
|
275 |
|
|
276 |
#pragma mark -
|
|
277 |
#pragma mark default routines
|
|
278 |
/*
|
|
279 |
---- Keyboard related functionality below this line ----
|
|
280 |
*/
|
|
281 |
#if SDL_IPHONE_KEYBOARD
|
|
282 |
|
|
283 |
/* Is the iPhone virtual keyboard visible onscreen? */
|
|
284 |
- (BOOL)keyboardVisible {
|
|
285 |
return keyboardVisible;
|
|
286 |
}
|
|
287 |
|
|
288 |
/* Set ourselves up as a UITextFieldDelegate */
|
|
289 |
- (void)initializeKeyboard {
|
|
290 |
|
|
291 |
textField = [[[UITextField alloc] initWithFrame: CGRectZero] autorelease];
|
|
292 |
textField.delegate = self;
|
|
293 |
/* placeholder so there is something to delete! */
|
|
294 |
textField.text = @" ";
|
|
295 |
|
|
296 |
/* set UITextInputTrait properties, mostly to defaults */
|
|
297 |
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
|
|
298 |
textField.autocorrectionType = UITextAutocorrectionTypeNo;
|
|
299 |
textField.enablesReturnKeyAutomatically = NO;
|
|
300 |
textField.keyboardAppearance = UIKeyboardAppearanceDefault;
|
|
301 |
textField.keyboardType = UIKeyboardTypeDefault;
|
|
302 |
textField.returnKeyType = UIReturnKeyDefault;
|
|
303 |
textField.secureTextEntry = NO;
|
|
304 |
|
|
305 |
textField.hidden = YES;
|
|
306 |
keyboardVisible = NO;
|
|
307 |
/* add the UITextField (hidden) to our view */
|
|
308 |
[self addSubview: textField];
|
|
309 |
|
|
310 |
/* create our SDL_Keyboard */
|
|
311 |
SDL_Keyboard keyboard;
|
|
312 |
SDL_zero(keyboard);
|
|
313 |
SDL_AddKeyboard(&keyboard, 0);
|
|
314 |
SDLKey keymap[SDL_NUM_SCANCODES];
|
|
315 |
SDL_GetDefaultKeymap(keymap);
|
|
316 |
SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
|
|
317 |
|
|
318 |
}
|
|
319 |
|
|
320 |
/* reveal onscreen virtual keyboard */
|
|
321 |
- (void)showKeyboard {
|
|
322 |
keyboardVisible = YES;
|
|
323 |
[textField becomeFirstResponder];
|
|
324 |
}
|
|
325 |
|
|
326 |
/* hide onscreen virtual keyboard */
|
|
327 |
- (void)hideKeyboard {
|
|
328 |
keyboardVisible = NO;
|
|
329 |
[textField resignFirstResponder];
|
|
330 |
}
|
|
331 |
|
|
332 |
/* UITextFieldDelegate method. Invoked when user types something. */
|
|
333 |
- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
|
|
334 |
|
|
335 |
if ([string length] == 0) {
|
|
336 |
/* it wants to replace text with nothing, ie a delete */
|
|
337 |
SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_DELETE);
|
|
338 |
SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_DELETE);
|
|
339 |
}
|
|
340 |
else {
|
|
341 |
/* go through all the characters in the string we've been sent
|
|
342 |
and convert them to key presses */
|
|
343 |
int i;
|
|
344 |
for (i=0; i<[string length]; i++) {
|
|
345 |
|
|
346 |
unichar c = [string characterAtIndex: i];
|
|
347 |
|
|
348 |
Uint16 mod = 0;
|
|
349 |
SDL_scancode code;
|
|
350 |
|
|
351 |
if (c < 127) {
|
|
352 |
/* figure out the SDL_scancode and SDL_keymod for this unichar */
|
|
353 |
code = unicharToUIKeyInfoTable[c].code;
|
|
354 |
mod = unicharToUIKeyInfoTable[c].mod;
|
|
355 |
}
|
|
356 |
else {
|
|
357 |
/* we only deal with ASCII right now */
|
|
358 |
code = SDL_SCANCODE_UNKNOWN;
|
|
359 |
mod = 0;
|
|
360 |
}
|
|
361 |
|
|
362 |
if (mod & KMOD_SHIFT) {
|
|
363 |
/* If character uses shift, press shift down */
|
|
364 |
SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_LSHIFT);
|
|
365 |
}
|
|
366 |
/* send a keydown and keyup even for the character */
|
|
367 |
SDL_SendKeyboardKey( 0, SDL_PRESSED, code);
|
|
368 |
SDL_SendKeyboardKey( 0, SDL_RELEASED, code);
|
|
369 |
if (mod & KMOD_SHIFT) {
|
|
370 |
/* If character uses shift, press shift back up */
|
|
371 |
SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_LSHIFT);
|
|
372 |
}
|
|
373 |
}
|
|
374 |
}
|
|
375 |
return NO; /* don't allow the edit! (keep placeholder text there) */
|
|
376 |
}
|
|
377 |
|
|
378 |
/* Terminates the editing session */
|
|
379 |
- (BOOL)textFieldShouldReturn:(UITextField*)_textField {
|
|
380 |
[self hideKeyboard];
|
|
381 |
return YES;
|
|
382 |
}
|
|
383 |
|
|
384 |
#endif
|
|
385 |
|
|
386 |
@end
|
|
387 |
|
|
388 |
/* iPhone keyboard addition functions */
|
|
389 |
#if SDL_IPHONE_KEYBOARD
|
|
390 |
|
|
391 |
int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) {
|
|
392 |
|
|
393 |
SDL_Window *window = SDL_GetWindowFromID(windowID);
|
|
394 |
SDL_WindowData *data;
|
|
395 |
SDL_uikitview *view;
|
|
396 |
|
|
397 |
if (NULL == window) {
|
|
398 |
SDL_SetError("Window does not exist");
|
|
399 |
return -1;
|
|
400 |
}
|
|
401 |
|
|
402 |
data = (SDL_WindowData *)window->driverdata;
|
|
403 |
view = data->view;
|
|
404 |
|
|
405 |
if (nil == view) {
|
|
406 |
SDL_SetError("Window has no view");
|
|
407 |
return -1;
|
|
408 |
}
|
|
409 |
else {
|
|
410 |
[view showKeyboard];
|
|
411 |
return 0;
|
|
412 |
}
|
|
413 |
}
|
|
414 |
|
|
415 |
int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) {
|
|
416 |
|
|
417 |
SDL_Window *window = SDL_GetWindowFromID(windowID);
|
|
418 |
SDL_WindowData *data;
|
|
419 |
SDL_uikitview *view;
|
|
420 |
|
|
421 |
if (NULL == window) {
|
|
422 |
SDL_SetError("Window does not exist");
|
|
423 |
return -1;
|
|
424 |
}
|
|
425 |
|
|
426 |
data = (SDL_WindowData *)window->driverdata;
|
|
427 |
view = data->view;
|
|
428 |
|
|
429 |
if (NULL == view) {
|
|
430 |
SDL_SetError("Window has no view");
|
|
431 |
return -1;
|
|
432 |
}
|
|
433 |
else {
|
|
434 |
[view hideKeyboard];
|
|
435 |
return 0;
|
|
436 |
}
|
|
437 |
}
|
|
438 |
|
|
439 |
SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) {
|
|
440 |
|
|
441 |
SDL_Window *window = SDL_GetWindowFromID(windowID);
|
|
442 |
SDL_WindowData *data;
|
|
443 |
SDL_uikitview *view;
|
|
444 |
|
|
445 |
if (NULL == window) {
|
|
446 |
SDL_SetError("Window does not exist");
|
|
447 |
return -1;
|
|
448 |
}
|
|
449 |
|
|
450 |
data = (SDL_WindowData *)window->driverdata;
|
|
451 |
view = data->view;
|
|
452 |
|
|
453 |
if (NULL == view) {
|
|
454 |
SDL_SetError("Window has no view");
|
|
455 |
return 0;
|
|
456 |
}
|
|
457 |
else {
|
|
458 |
return view.keyboardVisible;
|
|
459 |
}
|
|
460 |
}
|
|
461 |
|
|
462 |
int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) {
|
|
463 |
|
|
464 |
SDL_Window *window = SDL_GetWindowFromID(windowID);
|
|
465 |
SDL_WindowData *data;
|
|
466 |
SDL_uikitview *view;
|
|
467 |
|
|
468 |
if (NULL == window) {
|
|
469 |
SDL_SetError("Window does not exist");
|
|
470 |
return -1;
|
|
471 |
}
|
|
472 |
|
|
473 |
data = (SDL_WindowData *)window->driverdata;
|
|
474 |
view = data->view;
|
|
475 |
|
|
476 |
if (NULL == view) {
|
|
477 |
SDL_SetError("Window has no view");
|
|
478 |
return -1;
|
|
479 |
}
|
|
480 |
else {
|
|
481 |
if (SDL_iPhoneKeyboardIsShown(windowID)) {
|
|
482 |
SDL_iPhoneKeyboardHide(windowID);
|
|
483 |
}
|
|
484 |
else {
|
|
485 |
SDL_iPhoneKeyboardShow(windowID);
|
|
486 |
}
|
|
487 |
return 0;
|
|
488 |
}
|
|
489 |
}
|
|
490 |
|
|
491 |
#else
|
|
492 |
|
|
493 |
/* stubs, used if compiled without keyboard support */
|
|
494 |
|
|
495 |
int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) {
|
|
496 |
SDL_SetError("Not compiled with keyboard support");
|
|
497 |
return -1;
|
|
498 |
}
|
|
499 |
|
|
500 |
int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) {
|
|
501 |
SDL_SetError("Not compiled with keyboard support");
|
|
502 |
return -1;
|
|
503 |
}
|
|
504 |
|
|
505 |
SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) {
|
|
506 |
return 0;
|
|
507 |
}
|
|
508 |
|
|
509 |
int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) {
|
|
510 |
SDL_SetError("Not compiled with keyboard support");
|
|
511 |
return -1;
|
|
512 |
}
|
|
513 |
|
|
514 |
|
|
515 |
#endif /* SDL_IPHONE_KEYBOARD */
|