Loading...
Searching...
No Matches
key.h File Reference

Key-related macros and enums. More...

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

## Macros

#define | SDLK_LAST (SDLK_SCANCODE_MASK << 1)
#define | KEY(x)
#define | KEY_MOD(x)
#define | VIRTUAL_KMOD(x)
#define | VIRTUAL_JOY(num)

## Enumerations

enum | VirtualKmod { VIRTUAL_KMOD_CTRL = SDLK_LAST + 100 , VIRTUAL_KMOD_SHIFT = SDLK_LAST + 101 , VIRTUAL_KMOD_ALT = SDLK_LAST + 102 , VIRTUAL_KMOD_GUI = 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_CAM_LEFT , INPUT_SLOT_CAM_RIGHT , INPUT_SLOT_CAM_UP ,
INPUT_SLOT_CAM_DOWN , INPUT_SLOT_CAM_NEAR , INPUT_SLOT_CAM_AWAY , INPUT_SLOT_CAM_ALT ,
INPUT_SLOT_NEXT , INPUT_SLOT_HUMAN , INPUT_SLOT_QUIT , INPUT_SLOT_HELP ,
INPUT_SLOT_PROG , INPUT_SLOT_VISIT , INPUT_SLOT_SPEED_DEC , INPUT_SLOT_SPEED_RESET ,
INPUT_SLOT_SPEED_INC , INPUT_SLOT_QUICKSAVE , INPUT_SLOT_QUICKLOAD , INPUT_SLOT_PAUSE ,
INPUT_SLOT_CMDLINE , 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. More...
enum | JoyAxisSlot { JOY_AXIS_SLOT_X , JOY_AXIS_SLOT_Y , JOY_AXIS_SLOT_Z , JOY_AXIS_SLOT_CAM_X , JOY_AXIS_SLOT_CAM_Y , JOY_AXIS_SLOT_CAM_Z , JOY_AXIS_SLOT_MAX }
| Slots for joystick axes inputs. More...

## Functions

unsigned int | GetVirtualKey (unsigned int key, unsigned int kmodState)
| 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.

## Macro Definition Documentation

## KEY

#define KEY | ( |  | x | ) |

Value:
SDLK_ ## x

## KEY_MOD

#define KEY_MOD | ( |  | x | ) |

Value:
KMOD_ ## x

## VIRTUAL_KMOD

#define VIRTUAL_KMOD | ( |  | x | ) |

Value:
VIRTUAL_KMOD_ ## x

## VIRTUAL_JOY

#define VIRTUAL_JOY | ( |  | num | ) |

Value:
(SDLK_LAST + 200 + num)

## Enumeration Type Documentation

## VirtualKmod

enum VirtualKmod

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_GUI | < alt (left or right)

## InputSlot

enum InputSlot

Available slots for input bindings NOTE: When adding new values, remember to also update keyTable in input.cpp and their descriptions in restext.cpp.

## JoyAxisSlot

enum JoyAxisSlot

Slots for joystick axes inputs.

## Function Documentation

## GetVirtualKey()

unsigned int GetVirtualKey | ( | unsigned int | key,
|  | unsigned int | kmodState )

Converts individual codes to virtual keys if needed.

## Variable Documentation

## KEY_INVALID

const unsigned int KEY_INVALID = SDLK_LAST + 1000

Special value for invalid key bindings.