Oolite 1.91.0.7644-241112-7f5034b
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 "PlayerEntity.h"
28#import "GuiDisplayGen.h"
29#import "MyOpenGLView.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
42#define GUI_ROW_KC_CONFIRMCLEAR 5
43#define GUI_ROW_KC_CONFIRMCLEAR_YES 8
44#define GUI_ROW_KC_CONFIRMCLEAR_NO 9
45
46#define GUI_ROW_KC_UPDATE_FUNCNAME 1
47#define GUI_ROW_KC_KEY 3
48#define GUI_ROW_KC_SHIFT 4
49#define GUI_ROW_KC_MOD1 5
50#define GUI_ROW_KC_MOD2 6
51#define GUI_ROW_KC_UPDATE_INFO 13
52#define GUI_ROW_KC_VALIDATION 16
53#define GUI_ROW_KC_SAVE 17
54#define GUI_ROW_KC_CANCEL 18
55
56#define GUI_ROW_KC_ENTRY_INFO 2
57
58// Dictionary keys
59#define KEY_KC_GUIDESC @"guiDesc"
60#define KEY_KC_DEFINITION @"keyDef"
61#define KEY_KC_HEADER @"header"
62
63// Dictionary keys - used in the defaults file
64#define KEYCONFIG_OVERRIDES @"KeyConfigOverrides" // NSUserDefaults
65
66@interface PlayerEntity (KeyMapper)
67 - (void) resetKeyFunctions;
69
70 - (void) setGuiToKeyMapperScreen:(unsigned)skip resetCurrentRow:(BOOL)resetCurrentRow;
71 - (void) setGuiToKeyMapperScreen:(unsigned)skip;
72 - (void) keyMapperInputHandler:(GuiDisplayGen *)gui view:(MyOpenGLView *)gameView;
73
75 - (void) setGuiToKeyConfigScreen:(BOOL) resetSelectedRow;
76 - (void) handleKeyConfigKeys:(GuiDisplayGen *)gui view:(MyOpenGLView *)gameView;
77 - (void) outputKeyDefinition:(NSString *)key shift:(NSString *)shift mod1:(NSString *)mod1 mod2:(NSString *)mod2 skiprows:(NSUInteger)skiprows;
78
80 - (void) handleKeyConfigEntryKeys:(GuiDisplayGen *)gui view:(MyOpenGLView *)gameView;
81
83 - (void) handleKeyMapperConfirmClearKeys:(GuiDisplayGen *)gui view:(MyOpenGLView *)gameView;
84
85 - (void) setGuiToKeyboardLayoutScreen:(unsigned)skip;
86 - (void) setGuiToKeyboardLayoutScreen:(unsigned)skip resetCurrentRow:(BOOL)resetCurrentRow;
87 - (void) handleKeyboardLayoutEntryKeys:(GuiDisplayGen *)gui view:(MyOpenGLView *)gameView;
88
89 - (NSString *)validateKey:(NSString*)key checkKeys:(NSArray*)check_keys;
90
91 - (NSDictionary *)makeKeyGuiDict:(NSString *)what keyDef:(NSString *)keyDef;
92 - (NSDictionary *)makeKeyGuiDictHeader:(NSString *)header;
93
94@end