Oolite
Loading...
Searching...
No Matches
MyOpenGLView+Input.h
Go to the documentation of this file.
1/*
2
3MyOpenGLView+Input.h
4
5Oolite
6Copyright (C) 2004-2013 Giles C Williams and contributors
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21MA 02110-1301, USA.
22
23*/
24#pragma once
25
26#include <SDL3/SDL_events.h>
27
28@interface MyOpenGLView (Input)
29
30- (void)autoShowMouse;
31
32- (void)initKeyMappingData;
33
34- (void)setStringInput:(enum StringInput)value;
35- (void)allowStringInput:(BOOL)value;
37- (NSString*)typedString;
38- (void)resetTypedString;
39- (void)setTypedString:(NSString*)value;
40
41- (void)noteMouseInteractionModeChangedFrom:(OOMouseInteractionMode)oldMode to:(OOMouseInteractionMode)newMode;
42
43- (void)pollControls;
44
45- (void)setVirtualJoystick:(double)vmx vmy:(double)vmy;
47
48- (void)clearKeys;
49- (void)clearMouse;
50- (void)clearKey:(int)theKey;
51- (void)resetMouse;
52- (BOOL)isAlphabetKeyDown;
53- (void)suppressKeysUntilKeyUp; // DJS
54- (BOOL)isDown:(int)key;
55- (BOOL)isOptDown; // opt == alt key
56- (BOOL)isCtrlDown;
57- (BOOL)isCommandDown;
58- (BOOL)isShiftDown;
59- (BOOL)isCapsLockOn;
60- (BOOL)lastKeyWasShifted;
61- (int)numKeys;
63- (float)mouseWheelDelta;
64- (void)setMouseWheelDelta:(float)newWheelDelta;
65
66// Command-key combinations need special handling. SDL stubs for these mac functions.
67- (BOOL)isCommandQDown;
68- (BOOL)isCommandFDown;
69- (void)clearCommandF;
70
71- (void)setMouseInDeltaMode:(BOOL)inDelta;
72
73// DJS: String input handler. Since for SDL versions we're also handling
74// freeform typing this has necessarily got more complex than the non-SDL
75// versions.
76- (void)handleStringInput:(SDL_KeyboardEvent*)kbd_event keyID:(Uint16)key_id;
77
78@end
StringInput
OOMouseInteractionMode
enum StringInput allowingStringInput()
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque