diff --git a/base/keycodes.hpp b/base/keycodes.hpp index fd5dd091..64fccac8 100644 --- a/base/keycodes.hpp +++ b/base/keycodes.hpp @@ -17,16 +17,38 @@ #define KEY_S 0x53 #define KEY_D 0x44 #define KEY_P 0x50 +// +#define KEY_SPACE 0x20 +#define KEY_KPADD 0x6B +#define KEY_KPSUB 0x6D +#define KEY_B 0x42 +#define KEY_F 0x46 +#define KEY_L 0x4C +#define KEY_N 0x4E +#define KEY_O 0x4F +#define KEY_T 0x54 +// #elif defined(__ANDROID__) #elif defined(__linux__) #define KEY_ESCAPE 0x9 +#define KEY_F1 0x43 +#define KEY_F2 0x44 #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 +// +#define KEY_SPACE 0x41 +#define KEY_KPADD 0x56 +#define KEY_KPSUB 0x52 +#define KEY_B 0x38 +#define KEY_F 0x29 +#define KEY_L 0x2E +#define KEY_N 0x39 +#define KEY_O 0x20 +#define KEY_T 0x1C +// #endif // todo: Android gamepad keycodes outside of define for now @@ -36,4 +58,4 @@ #define GAMEPAD_BUTTON_Y 0x1003 #define GAMEPAD_BUTTON_L1 0x1004 #define GAMEPAD_BUTTON_R1 0x1005 -#define GAMEPAD_BUTTON_START 0x1006 \ No newline at end of file +#define GAMEPAD_BUTTON_START 0x1006 diff --git a/bloom/bloom.cpp b/bloom/bloom.cpp index c076537a..62b9cf33 100644 --- a/bloom/bloom.cpp +++ b/bloom/bloom.cpp @@ -1113,15 +1113,15 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeBlurScale(0.25f); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeBlurScale(-0.25f); break; - case 0x42: + case KEY_B: case GAMEPAD_BUTTON_A: toggleBloom(); break; @@ -1212,4 +1212,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/computeshader/computeshader.cpp b/computeshader/computeshader.cpp index d9e7c298..7701ca66 100644 --- a/computeshader/computeshader.cpp +++ b/computeshader/computeshader.cpp @@ -774,11 +774,11 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: switchComputePipeline(1); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: switchComputePipeline(-1); break; diff --git a/deferred/deferred.cpp b/deferred/deferred.cpp index 66830076..c5a3a626 100644 --- a/deferred/deferred.cpp +++ b/deferred/deferred.cpp @@ -1221,7 +1221,7 @@ public: { switch (keyCode) { - case 0x70: + case KEY_F1: case GAMEPAD_BUTTON_A: toggleDebugDisplay(); updateTextOverlay(); @@ -1247,4 +1247,4 @@ public: } }; -VULKAN_EXAMPLE_MAIN() \ No newline at end of file +VULKAN_EXAMPLE_MAIN() diff --git a/deferredshadows/deferredshadows.cpp b/deferredshadows/deferredshadows.cpp index a2f97f9a..51f8ef02 100644 --- a/deferredshadows/deferredshadows.cpp +++ b/deferredshadows/deferredshadows.cpp @@ -1208,12 +1208,12 @@ public: { switch (keyCode) { - case 0x70: + case KEY_F1: case GAMEPAD_BUTTON_A: toggleDebugDisplay(); updateTextOverlay(); break; - case 0x71: + case KEY_F2: case GAMEPAD_BUTTON_X: toggleShadows(); updateTextOverlay(); @@ -1233,4 +1233,4 @@ public: } }; -VULKAN_EXAMPLE_MAIN() \ No newline at end of file +VULKAN_EXAMPLE_MAIN() diff --git a/displacement/displacement.cpp b/displacement/displacement.cpp index a52840b0..69230035 100644 --- a/displacement/displacement.cpp +++ b/displacement/displacement.cpp @@ -557,19 +557,19 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeTessellationStrength(0.025); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeTessellationStrength(-0.025); break; - case 0x44: + case KEY_D: case GAMEPAD_BUTTON_A: toggleDisplacement(); break; - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_X: toggleSplitScreen(); break; @@ -651,4 +651,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/distancefieldfonts/distancefieldfonts.cpp b/distancefieldfonts/distancefieldfonts.cpp index fdf2cbc6..4256ee49 100644 --- a/distancefieldfonts/distancefieldfonts.cpp +++ b/distancefieldfonts/distancefieldfonts.cpp @@ -716,11 +716,11 @@ public: { switch (keyCode) { - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_X: toggleSplitScreen(); break; - case 0x4F: + case KEY_O: case GAMEPAD_BUTTON_A: toggleFontOutline(); break; @@ -799,4 +799,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/geometryshader/geometryshader.cpp b/geometryshader/geometryshader.cpp index 482fbd6f..cc189035 100644 --- a/geometryshader/geometryshader.cpp +++ b/geometryshader/geometryshader.cpp @@ -478,7 +478,7 @@ public: { switch (keyCode) { - case 0x4E: + case KEY_N: case GAMEPAD_BUTTON_A: toggleNormals(); break; @@ -554,4 +554,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/offscreen/offscreen.cpp b/offscreen/offscreen.cpp index 523b53c2..a91b8884 100644 --- a/offscreen/offscreen.cpp +++ b/offscreen/offscreen.cpp @@ -996,7 +996,7 @@ public: { switch (keyCode) { - case 0x44: + case KEY_D: case GAMEPAD_BUTTON_A: toggleDebugDisplay(); break; @@ -1078,4 +1078,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/parallaxmapping/parallaxmapping.cpp b/parallaxmapping/parallaxmapping.cpp index a1cd9bfe..4ef05653 100644 --- a/parallaxmapping/parallaxmapping.cpp +++ b/parallaxmapping/parallaxmapping.cpp @@ -583,15 +583,15 @@ public: { switch (keyCode) { - case 0x4F: + case KEY_O: case GAMEPAD_BUTTON_A: toggleParallaxOffset(); break; - case 0x4E: + case KEY_N: case GAMEPAD_BUTTON_X: toggleNormalMapDisplay(); break; - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_Y: toggleSplitScreen(); break; @@ -671,4 +671,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/radialblur/radialblur.cpp b/radialblur/radialblur.cpp index d515d240..4fb8ad83 100644 --- a/radialblur/radialblur.cpp +++ b/radialblur/radialblur.cpp @@ -980,11 +980,11 @@ public: { switch (keyCode) { - case 0x42: + case KEY_B: case GAMEPAD_BUTTON_A: toggleBlur(); break; - case 0x54: + case KEY_T: case GAMEPAD_BUTTON_X: toggleTextureDisplay(); break; @@ -1076,4 +1076,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/scenerendering/scenerendering.cpp b/scenerendering/scenerendering.cpp index aedbd9ab..525dc01c 100644 --- a/scenerendering/scenerendering.cpp +++ b/scenerendering/scenerendering.cpp @@ -832,27 +832,27 @@ public: { switch (keyCode) { - case 0x20: + case KEY_SPACE: case GAMEPAD_BUTTON_A: wireframe = !wireframe; reBuildCommandBuffers(); break; - case 0x50: + case KEY_P: scene->renderSingleScenePart = !scene->renderSingleScenePart; reBuildCommandBuffers(); updateTextOverlay(); break; - case 0x6B: + case KEY_KPADD: scene->scenePartIndex = (scene->scenePartIndex < static_cast(scene->meshes.size())) ? scene->scenePartIndex + 1 : 0; reBuildCommandBuffers(); updateTextOverlay(); break; - case 0x6D: + case KEY_KPSUB: scene->scenePartIndex = (scene->scenePartIndex > 0) ? scene->scenePartIndex - 1 : static_cast(scene->meshes.size()) - 1; updateTextOverlay(); reBuildCommandBuffers(); break; - case 0x4C: + case KEY_L: attachLight = !attachLight; updateUniformBuffers(); break; @@ -936,4 +936,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/shadowmapping/shadowmapping.cpp b/shadowmapping/shadowmapping.cpp index b53cee26..83264ebd 100644 --- a/shadowmapping/shadowmapping.cpp +++ b/shadowmapping/shadowmapping.cpp @@ -1019,11 +1019,11 @@ public: { switch (keyCode) { - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_A: toggleShadowMapDisplay(); break; - case 0x4C: + case KEY_L: case GAMEPAD_BUTTON_X: toogleLightPOV(); break; @@ -1102,4 +1102,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/shadowmappingomni/shadowmappingomni.cpp b/shadowmappingomni/shadowmappingomni.cpp index d4e1b9dd..05622d58 100644 --- a/shadowmappingomni/shadowmappingomni.cpp +++ b/shadowmappingomni/shadowmappingomni.cpp @@ -1068,7 +1068,7 @@ public: { switch (keyCode) { - case 0x44: + case KEY_D: case GAMEPAD_BUTTON_A: toggleCubeMapDisplay(); break; @@ -1151,4 +1151,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/skeletalanimation/skeletalanimation.cpp b/skeletalanimation/skeletalanimation.cpp index 4df86a84..4bccb211 100644 --- a/skeletalanimation/skeletalanimation.cpp +++ b/skeletalanimation/skeletalanimation.cpp @@ -1036,11 +1036,11 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeAnimationSpeed(0.1f); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeAnimationSpeed(-0.1f); break; @@ -1121,4 +1121,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/sphericalenvmapping/sphericalenvmapping.cpp b/sphericalenvmapping/sphericalenvmapping.cpp index c306120c..c927d4bf 100644 --- a/sphericalenvmapping/sphericalenvmapping.cpp +++ b/sphericalenvmapping/sphericalenvmapping.cpp @@ -452,12 +452,12 @@ public: { switch (keyCode) { - case 0x6B: - case 0x20: + case KEY_KPADD: + case KEY_SPACE: case GAMEPAD_BUTTON_A: changeMatCapIndex(1); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_X: changeMatCapIndex(-1); break; @@ -548,4 +548,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/terraintessellation/terraintessellation.cpp b/terraintessellation/terraintessellation.cpp index 91550f0e..575f9594 100644 --- a/terraintessellation/terraintessellation.cpp +++ b/terraintessellation/terraintessellation.cpp @@ -939,19 +939,19 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeTessellationFactor(0.05f); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeTessellationFactor(-0.05f); break; - case 0x46: + case KEY_F: case GAMEPAD_BUTTON_A: toggleWireframe(); break; - case 0x54: + case KEY_T: case GAMEPAD_BUTTON_X: toggleTessellation(); break; @@ -1038,4 +1038,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/tessellation/tessellation.cpp b/tessellation/tessellation.cpp index 355ee087..158a1d94 100644 --- a/tessellation/tessellation.cpp +++ b/tessellation/tessellation.cpp @@ -533,19 +533,19 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeTessellationLevel(0.25); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeTessellationLevel(-0.25); break; - case 0x57: + case KEY_W: case GAMEPAD_BUTTON_A: togglePipelines(); break; - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_X: toggleSplitScreen(); break; @@ -655,4 +655,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/textoverlay/textoverlay.cpp b/textoverlay/textoverlay.cpp index 433481f5..7433a75c 100644 --- a/textoverlay/textoverlay.cpp +++ b/textoverlay/textoverlay.cpp @@ -1198,8 +1198,8 @@ public: { switch (keyCode) { - case 0x6B: - case 0x20: + case KEY_KPADD: + case KEY_SPACE: textOverlay->visible = !textOverlay->visible; } } @@ -1264,4 +1264,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +} diff --git a/texture/texture.cpp b/texture/texture.cpp index 97c5f989..5040b999 100644 --- a/texture/texture.cpp +++ b/texture/texture.cpp @@ -875,11 +875,11 @@ public: { switch (keyCode) { - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeLodBias(0.1f); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeLodBias(-0.1f); break; @@ -898,4 +898,4 @@ public: } }; -VULKAN_EXAMPLE_MAIN() \ No newline at end of file +VULKAN_EXAMPLE_MAIN() diff --git a/texturecubemap/texturecubemap.cpp b/texturecubemap/texturecubemap.cpp index 59c3bbfc..35af0c42 100644 --- a/texturecubemap/texturecubemap.cpp +++ b/texturecubemap/texturecubemap.cpp @@ -737,19 +737,19 @@ public: { switch (keyCode) { - case 0x53: + case KEY_S: case GAMEPAD_BUTTON_A: toggleSkyBox(); break; - case 0x20: + case KEY_SPACE: case GAMEPAD_BUTTON_X: toggleObject(); break; - case 0x6B: + case KEY_KPADD: case GAMEPAD_BUTTON_R1: changeLodBias(0.1f); break; - case 0x6D: + case KEY_KPSUB: case GAMEPAD_BUTTON_L1: changeLodBias(-0.1f); break; @@ -831,4 +831,4 @@ int main(const int argc, const char *argv[]) #if !defined(__ANDROID__) return 0; #endif -} \ No newline at end of file +}