39 lines
No EOL
906 B
C++
39 lines
No EOL
906 B
C++
/*
|
|
* Key codes for multiple platforms
|
|
*
|
|
* Copyright (C) 2016 by Sascha Willems - www.saschawillems.de
|
|
*
|
|
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#if defined(_WIN32)
|
|
#define KEY_ESCAPE VK_ESCAPE
|
|
#define KEY_F1 VK_F1
|
|
#define KEY_F2 VK_F2
|
|
#define KEY_W 0x57
|
|
#define KEY_A 0x41
|
|
#define KEY_S 0x53
|
|
#define KEY_D 0x44
|
|
#define KEY_P 0x50
|
|
#elif defined(__ANDROID__)
|
|
#elif defined(__linux__)
|
|
#define KEY_ESCAPE 0x9
|
|
#define KEY_W 0x19
|
|
#define KEY_A 0x26
|
|
#define KEY_S 0x27
|
|
#define KEY_D 0x28
|
|
#define KEY_P 0x21
|
|
#define KEY_F1 0x43
|
|
#define KEY_F2 0x44
|
|
#endif
|
|
|
|
// todo: Android gamepad keycodes outside of define for now
|
|
#define GAMEPAD_BUTTON_A 0x1000
|
|
#define GAMEPAD_BUTTON_B 0x1001
|
|
#define GAMEPAD_BUTTON_X 0x1002
|
|
#define GAMEPAD_BUTTON_Y 0x1003
|
|
#define GAMEPAD_BUTTON_L1 0x1004
|
|
#define GAMEPAD_BUTTON_R1 0x1005
|
|
#define GAMEPAD_BUTTON_START 0x1006 |