{"id":1108,"date":"2018-10-24T20:50:57","date_gmt":"2018-10-24T20:50:57","guid":{"rendered":"https:\/\/lab.florianschwarz.net\/PennController\/?post_type=yada_wiki&#038;p=1108"},"modified":"2018-10-24T20:50:57","modified_gmt":"2018-10-24T20:50:57","slug":"key-settings-log","status":"publish","type":"yada_wiki","link":"https:\/\/lab.florianschwarz.net\/PennController\/wiki\/key-settings-log\/","title":{"rendered":"key.settings.log"},"content":{"rendered":"<p class='command-format'><code>getKey(id).settings.log()<\/code><\/p>\n<p class='command-format'>or <code>getKey(id).settings.log(\"wait\")<\/code> <em>(since beta 0.4)<\/em><\/p>\n<p class='command-format'>or <code>getKey(id).settings.log(\"first\")<\/code> <em>(since beta 0.4)<\/em><\/p>\n<p class='command-format'>or <code>getKey(id).settings.log(\"last\")<\/code> <em>(since beta 0.4)<\/em><\/p>\n<p class='command-format'>or <code>getKey(id).settings.log(\"all\")<\/code><\/p>\n<p>A line will be added to the results file indicating which key was pressed when.<\/p>\n<p>If you leave the parentheses blank or pass <code>\"wait\"<\/code> (those are equivalent) then key presses will only be logged if they validate a <code>.wait<\/code> command on the Key element.<\/p>\n<p>If you pass <code>\"first\"<\/code> then the first key press on one of the specified keys will be logged (regardless of whether it validates a <code>.wait<\/code> command). Correspondingly, if you pass <code>\"last\"<\/code> then the last valid key press will be logged. If you pass <code>\"all\"<\/code> then all key presses will be logged.<\/p>\n<p><strong>Note:<\/strong> <code>\"all\"<\/code> (or blank, its equivalent) was the only available option in beta 0.3.<\/p>\n<p>[js highlight=&#8221;5&#8243;]newText(&#8220;instructions&#8221;, &#8220;Please press any key&#8221;)<br \/>\n    .print()<br \/>\n,<br \/>\nnewKey(&#8220;anyKey&#8221;, &#8220;&#8221;)<br \/>\n    .settings.log()<br \/>\n    .wait()<br \/>\n,<br \/>\nnewText(&#8220;thanks&#8221;, &#8220;Thank you!&#8221;)<br \/>\n    .print()[\/js]<\/p>\n<p>Adds a text asking for a press on any key, after which the text <em>Thank you!<\/em> get printed below. The results file will contain a line indicating which key was pressed, and at what time(stamp) it was pressed.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"wiki_cats":[13,5,4,22,14],"wiki_tags":[],"class_list":["post-1108","yada_wiki","type-yada_wiki","status-publish","hentry","wiki_cats-command","wiki_cats-documentation","wiki_cats-element","wiki_cats-key-element","wiki_cats-settings-command"],"_links":{"self":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki"}],"about":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/types\/yada_wiki"}],"author":[{"embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/comments?post=1108"}],"version-history":[{"count":1,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1108\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1108\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/media?parent=1108"}],"wp:term":[{"taxonomy":"wiki_cats","embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/wiki_cats?post=1108"},{"taxonomy":"wiki_tags","embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/wiki_tags?post=1108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}