keys.h 2.65 KB
Newer Older
Alam Ed Arias committed
1 2 3
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
James R. committed
4
// Copyright (C) 1999-2020 by Sonic Team Junior.
Alam Ed Arias committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file  keys.h
/// \brief SRB2 keyboard definition

#ifndef __KEYS_H__
#define __KEYS_H__

// These are the key codes as posted by the keyboard handler,
// ascii codes are 0->127,
// scancodes are 0x80 + 0->127

#define KEY_NULL      0 // null key, triggers nothing
#define KEY_BACKSPACE 8
#define KEY_TAB       9
#define KEY_ENTER    13
#define KEY_ESCAPE   27
#define KEY_SPACE    32
#define KEY_MINUS    45
#define KEY_EQUALS   61

#define KEY_NUMLOCK    (0x80+69)
#define KEY_SCROLLLOCK (0x80+70)

//
//  scancodes 71-83 (non-extended)
//
#define KEY_KEYPAD7  (0x80+71)
#define KEY_KEYPAD8  (0x80+72)
#define KEY_KEYPAD9  (0x80+73)
#define KEY_MINUSPAD (0x80+74)
#define KEY_KEYPAD4  (0x80+75)
#define KEY_KEYPAD5  (0x80+76)
#define KEY_KEYPAD6  (0x80+77)
#define KEY_PLUSPAD  (0x80+78)
#define KEY_KEYPAD1  (0x80+79)
#define KEY_KEYPAD2  (0x80+80)
#define KEY_KEYPAD3  (0x80+81)
#define KEY_KEYPAD0  (0x80+82)
#define KEY_KPADDEL  (0x80+83)

// windows95 keys

#define KEY_LEFTWIN  (0x80+91)
#define KEY_RIGHTWIN (0x80+92)
#define KEY_MENU     (0x80+93)

// scancodes 71-83 EXTENDED are remapped to these by the keyboard handler (just add 30)
#define KEY_KPADSLASH  (0x80+100) // extended scancode 53 '/' remapped
#define KEY_HOME       (0x80+101)
#define KEY_UPARROW    (0x80+102)
#define KEY_PGUP       (0x80+103)
#define KEY_LEFTARROW  (0x80+105)
#define KEY_RIGHTARROW (0x80+107)
#define KEY_END        (0x80+109)
#define KEY_DOWNARROW  (0x80+110)
#define KEY_PGDN       (0x80+111)
#define KEY_INS        (0x80+112)
#define KEY_DEL        (0x80+113)

#define KEY_F1  (0x80+0x3b)
#define KEY_F2  (0x80+0x3c)
#define KEY_F3  (0x80+0x3d)
#define KEY_F4  (0x80+0x3e)
#define KEY_F5  (0x80+0x3f)
#define KEY_F6  (0x80+0x40)
#define KEY_F7  (0x80+0x41)
#define KEY_F8  (0x80+0x42)
#define KEY_F9  (0x80+0x43)
#define KEY_F10 (0x80+0x44)
#define KEY_F11 (0x80+0x57)
#define KEY_F12 (0x80+0x58)

#define KEY_PAUSE 255

// these ones must be non-extended scancodes (rctrl, rshift, lalt)
#define KEY_LSHIFT (0x80+54)
#define KEY_RSHIFT (0x80+55)
#define KEY_LCTRL  (0x80+29)
#define KEY_RCTRL  (0x80+30)
#define KEY_LALT   (0x80+56)
#define KEY_RALT   (0x80+57)

#define KEY_CAPSLOCK (0x80+58)
#define KEY_CONSOLE  '`'

#define KEY_OPENBRACKETS
#define KEY_CLOSEBRACKETS

#endif