Oolite
Loading...
Searching...
No Matches
PlayerEntityKeyMapper.h
Go to the documentation of this file.
1/*
2
3PlayerEntityKeyMapper.h
4
5Joystick support for SDL implementation of Oolite.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
27#import "GuiDisplayGen.h"
28#import "MyOpenGLView.h"
29#import "PlayerEntity.h"
30#import "Universe.h"
31
32#define MAX_ROWS_KC_FUNCTIONS 12
33
34#define GUI_ROW_KC_SELECTKBD 1
35#define GUI_ROW_KC_HEADING 4
36#define GUI_ROW_KC_FUNCSTART 5
37#define GUI_ROW_KC_FUNCEND (GUI_ROW_KC_FUNCSTART + MAX_ROWS_KC_FUNCTIONS - 1)
38#define GUI_ROW_KC_ERROR 17
39#define GUI_ROW_KC_INSTRUCT 18
40
41#define GUI_ROW_KC_CONFIRMCLEAR 5
42#define GUI_ROW_KC_CONFIRMCLEAR_YES 8
43#define GUI_ROW_KC_CONFIRMCLEAR_NO 9
44
45#define GUI_ROW_KC_UPDATE_FUNCNAME 1
46#define GUI_ROW_KC_KEY 3
47#define GUI_ROW_KC_SHIFT 4
48#define GUI_ROW_KC_MOD1 5
49#define GUI_ROW_KC_MOD2 6
50#define GUI_ROW_KC_UPDATE_INFO 13
51#define GUI_ROW_KC_VALIDATION 16
52#define GUI_ROW_KC_SAVE 17
53#define GUI_ROW_KC_CANCEL 18
54
55#define GUI_ROW_KC_ENTRY_INFO 2
56
57// Dictionary keys
58#define KEY_KC_GUIDESC @"guiDesc"
59#define KEY_KC_DEFINITION @"keyDef"
60#define KEY_KC_HEADER @"header"
61
62// Dictionary keys - used in the defaults file
63#define KEYCONFIG_OVERRIDES @"KeyConfigOverrides" // NSUserDefaults
64
65@interface PlayerEntity (KeyMapper)
66- (void)resetKeyFunctions;
68
69- (void)setGuiToKeyMapperScreen:(unsigned)skip resetCurrentRow:(BOOL)resetCurrentRow;
70- (void)setGuiToKeyMapperScreen:(unsigned)skip;
71- (void)keyMapperInputHandler:(GuiDisplayGen*)gui view:(MyOpenGLView*)gameView;
72
74- (void)setGuiToKeyConfigScreen:(BOOL)resetSelectedRow;
75- (void)handleKeyConfigKeys:(GuiDisplayGen*)gui view:(MyOpenGLView*)gameView;
76- (void)outputKeyDefinition:(NSString*)key shift:(NSString*)shift mod1:(NSString*)mod1 mod2:(NSString*)mod2 skiprows:(NSUInteger)skiprows;
77
79- (void)handleKeyConfigEntryKeys:(GuiDisplayGen*)gui view:(MyOpenGLView*)gameView;
80
82- (void)handleKeyMapperConfirmClearKeys:(GuiDisplayGen*)gui view:(MyOpenGLView*)gameView;
83
84- (void)setGuiToKeyboardLayoutScreen:(unsigned)skip;
85- (void)setGuiToKeyboardLayoutScreen:(unsigned)skip resetCurrentRow:(BOOL)resetCurrentRow;
86- (void)handleKeyboardLayoutEntryKeys:(GuiDisplayGen*)gui view:(MyOpenGLView*)gameView;
87
88- (NSString*)validateKey:(NSString*)key checkKeys:(NSArray*)check_keys;
89
90- (NSDictionary*)makeKeyGuiDict:(NSString*)what keyDef:(NSString*)keyDef;
91- (NSDictionary*)makeKeyGuiDictHeader:(NSString*)header;
92
93@end