Changeset View
Changeset View
Standalone View
Standalone View
source/ps/KeyName.h
Show All 17 Lines | |||||
#ifndef INCLUDED_KEYNAME | #ifndef INCLUDED_KEYNAME | ||||
#define INCLUDED_KEYNAME | #define INCLUDED_KEYNAME | ||||
// Need SDLK_* enum values. | // Need SDLK_* enum values. | ||||
#include "lib/external_libraries/libsdl.h" | #include "lib/external_libraries/libsdl.h" | ||||
class CStr8; | class CStr8; | ||||
extern void InitKeyNameMap(); | extern SDL_Scancode FindScancode(const CStr& keyname); | ||||
extern CStr8 FindKeyName(int keycode); | // Map a scancode to a locale-independent scancode name. | ||||
extern int FindKeyCode(const CStr8& keyname); | extern CStr8 FindScancodeName(SDL_Scancode scancode); | ||||
Stan: Should we use the alias CStr here and below ? | |||||
Done Inline ActionsNo, as CStr isn't an actual class, it's a #define literal. The class is CStr8 and I must use it if I don't include Str.h wraitii: No, as CStr isn't an actual class, it's a #define literal. The class is CStr8 and I must use it… | |||||
// Map a scancode to a locale-dependent key name (to show the user). | |||||
extern CStr8 FindKeyName(SDL_Scancode scancode); | |||||
enum { | enum { | ||||
// Start sequential IDs in the right place | // Start sequential IDs in the right place | ||||
// Pick a code which is greater than any keycodes used by SDL itself | // Pick a code which is greater than any scancodes used by SDL itself | ||||
EXTRA_KEYS_BASE = SDL_SCANCODE_TO_KEYCODE(SDL_NUM_SCANCODES), | EXTRA_KEYS_BASE = SDL_NUM_SCANCODES, | ||||
// 'Keycodes' for the unified modifier keys | // 'Keycodes' for the unified modifier keys | ||||
UNIFIED_SHIFT, | UNIFIED_SHIFT, | ||||
UNIFIED_CTRL, | UNIFIED_CTRL, | ||||
UNIFIED_ALT, | UNIFIED_ALT, | ||||
UNIFIED_SUPER, | UNIFIED_SUPER, | ||||
UNIFIED_LAST, | UNIFIED_LAST, | ||||
// 'Keycodes' for the mouse buttons | // 'Keycodes' for the mouse buttons | ||||
// Base for mouse buttons. | // Base for mouse buttons. | ||||
Show All 15 Lines |
Wildfire Games · Phabricator
Should we use the alias CStr here and below ?