Windows keycodes, moved gamepad keycodes (Android) to keycodes header
This commit is contained in:
parent
563d7c4b9c
commit
ed71ae00c3
3 changed files with 24 additions and 19 deletions
|
|
@ -11,7 +11,11 @@
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#define KEY_ESCAPE VK_ESCAPE
|
#define KEY_ESCAPE VK_ESCAPE
|
||||||
#define KEY_F1 VK_F1
|
#define KEY_F1 VK_F1
|
||||||
#define KEY_F1 VK_F2
|
#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
|
#define KEY_P 0x50
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__)
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
|
|
@ -24,3 +28,12 @@
|
||||||
#define KEY_F1 0x43
|
#define KEY_F1 0x43
|
||||||
#define KEY_F2 0x44
|
#define KEY_F2 0x44
|
||||||
#endif
|
#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
|
||||||
|
|
@ -1039,7 +1039,7 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
textOverlay->visible = !textOverlay->visible;
|
textOverlay->visible = !textOverlay->visible;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VK_ESCAPE:
|
case KEY_ESCAPE:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1048,16 +1048,16 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
{
|
{
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
{
|
{
|
||||||
case 0x57:
|
case KEY_W:
|
||||||
camera.keys.up = true;
|
camera.keys.up = true;
|
||||||
break;
|
break;
|
||||||
case 0x53:
|
case KEY_S:
|
||||||
camera.keys.down = true;
|
camera.keys.down = true;
|
||||||
break;
|
break;
|
||||||
case 0x41:
|
case KEY_A:
|
||||||
camera.keys.left = true;
|
camera.keys.left = true;
|
||||||
break;
|
break;
|
||||||
case 0x44:
|
case KEY_D:
|
||||||
camera.keys.right = true;
|
camera.keys.right = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1070,16 +1070,16 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
{
|
{
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
{
|
{
|
||||||
case 0x57:
|
case KEY_W:
|
||||||
camera.keys.up = false;
|
camera.keys.up = false;
|
||||||
break;
|
break;
|
||||||
case 0x53:
|
case KEY_S:
|
||||||
camera.keys.down = false;
|
camera.keys.down = false;
|
||||||
break;
|
break;
|
||||||
case 0x41:
|
case KEY_A:
|
||||||
camera.keys.left = false;
|
camera.keys.left = false;
|
||||||
break;
|
break;
|
||||||
case 0x44:
|
case KEY_D:
|
||||||
camera.keys.right = false;
|
camera.keys.right = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,6 @@
|
||||||
#include "vulkantextoverlay.hpp"
|
#include "vulkantextoverlay.hpp"
|
||||||
#include "camera.hpp"
|
#include "camera.hpp"
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
// Function pointer for getting physical device fetures to be enabled
|
// Function pointer for getting physical device fetures to be enabled
|
||||||
typedef VkPhysicalDeviceFeatures (*PFN_GetEnabledFeatures)();
|
typedef VkPhysicalDeviceFeatures (*PFN_GetEnabledFeatures)();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue