Colobot
Macros | Enumerations | Functions | Variables
key.h File Reference

Key-related macros and enums. More...

#include <SDL_keysym.h>
Include dependency graph for key.h:

Go to the source code of this file.

Macros

#define KEY(x)   SDLK_ ## x
 
#define KEY_MOD(x)   KMOD_ ## x
 
#define VIRTUAL_KMOD(x)   VIRTUAL_KMOD_ ## x
 
#define VIRTUAL_JOY(num)   (SDLK_LAST + 200 + num)
 

Enumerations

enum  VirtualKmod { VIRTUAL_KMOD_CTRL = SDLK_LAST + 100, VIRTUAL_KMOD_SHIFT = SDLK_LAST + 101, VIRTUAL_KMOD_ALT = SDLK_LAST + 102, VIRTUAL_KMOD_META = SDLK_LAST + 103 }
 Virtual key codes generated on kmod presses. More...
 
enum  InputSlot {
  INPUT_SLOT_LEFT, INPUT_SLOT_RIGHT, INPUT_SLOT_UP, INPUT_SLOT_DOWN,
  INPUT_SLOT_GUP, INPUT_SLOT_GDOWN, INPUT_SLOT_CAMERA, INPUT_SLOT_DESEL,
  INPUT_SLOT_ACTION, INPUT_SLOT_NEAR, INPUT_SLOT_AWAY, INPUT_SLOT_NEXT,
  INPUT_SLOT_HUMAN, INPUT_SLOT_QUIT, INPUT_SLOT_HELP, INPUT_SLOT_PROG,
  INPUT_SLOT_VISIT, INPUT_SLOT_SPEED05, INPUT_SLOT_SPEED10, INPUT_SLOT_SPEED15,
  INPUT_SLOT_SPEED20, INPUT_SLOT_SPEED30, INPUT_SLOT_SPEED40, INPUT_SLOT_SPEED60,
  INPUT_SLOT_CAMERA_UP, INPUT_SLOT_CAMERA_DOWN, INPUT_SLOT_PAUSE, INPUT_SLOT_MAX
}
 Available slots for input bindings NOTE: When adding new values, remember to also update keyTable in input.cpp and their descriptions in restext.cpp.
 
enum  JoyAxisSlot { JOY_AXIS_SLOT_X, JOY_AXIS_SLOT_Y, JOY_AXIS_SLOT_Z, JOY_AXIS_SLOT_MAX }
 Slots for joystick axes inputs.
 

Functions

unsigned int GetVirtualKey (unsigned int key)
 Converts individual codes to virtual keys if needed.
 

Variables

const unsigned int KEY_INVALID = SDLK_LAST + 1000
 Special value for invalid key bindings.
 

Detailed Description

Key-related macros and enums.

Enumeration Type Documentation

Virtual key codes generated on kmod presses.

These are provided here because left and right pair of keys generate different codes.

Enumerator
VIRTUAL_KMOD_SHIFT 

< control (left or right)

VIRTUAL_KMOD_ALT 

< shift (left or right)

VIRTUAL_KMOD_META 

< alt (left or right)