{"id":1296,"date":"2015-03-23T00:15:22","date_gmt":"2015-03-23T00:15:22","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1296"},"modified":"2015-03-23T00:15:22","modified_gmt":"2015-03-23T00:15:22","slug":"p-156-update-15-text-input","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-156-update-15-text-input\/","title":{"rendered":"P-156: Update 15: Text Input"},"content":{"rendered":"<p>I have been working on adding basic text input to this project, and it is turning out to be surprisingly difficult.<\/p>\n<p>I know that I can use glfwGetKey() to get a specific key, such as:\u00a0if (glfwGetKey(window, GLFW_KEY_UP ) == GLFW_PRESS), however, I had some issues figuring out how to accept a text string from the user.<\/p>\n<p>Eventually, I figured out that to capture a text string, I needed to use a keyboard callback, something like this:<\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">static void KeyboardCallback(GLFWwindow* window, int key, int scancode, int action, int mods)<br \/>\n{<\/p>\n<p>if(action == GLFW_PRESS){<\/p>\n<p style=\"text-align: justify;\">\/\/This fires when ANY key is pressed<\/p>\n<p style=\"text-align: justify;\">}<\/p>\n<p style=\"text-align: justify;\">}<\/p>\n<p style=\"text-align: justify;\">\n<p style=\"text-align: justify;\">Text input is not fully working yet, but it is very close.<\/p>\n<p style=\"text-align: justify;\">\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I have been working on adding basic text input to this project, and it is turning out to be surprisingly difficult. I know that I can use glfwGetKey() to get a specific key, such as:\u00a0if (glfwGetKey(window, GLFW_KEY_UP ) == GLFW_PRESS), however, I had some issues figuring out how to accept a text string from the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,16],"tags":[],"class_list":["post-1296","post","type-post","status-publish","format-standard","hentry","category-software-and-games","category-software-engines","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1296"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=1296"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1296\/revisions"}],"predecessor-version":[{"id":1297,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1296\/revisions\/1297"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}