<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Key pressed bug]]></title><description><![CDATA[<p dir="auto">For some reason the following code crashes the site:</p>
<pre><code>when [any] key released
set [#] to ("0")
repeat("10")
 if &lt;key (#) is pressed&gt; then
  set [type] to (#)
 end
 change [#] by ("1")
end
</code></pre>
]]></description><link>https://forum.creaticode.com/topic/1024/key-pressed-bug</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 20:29:20 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/1024.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 29 Nov 2023 16:20:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Key pressed bug on Thu, 30 Nov 2023 04:41:47 GMT]]></title><description><![CDATA[<p dir="auto">FYI the issue with the “key ( ) is pressed” block has been fixed. Thanks for reporting the issue.</p>
]]></description><link>https://forum.creaticode.com/post/1157</link><guid isPermaLink="true">https://forum.creaticode.com/post/1157</guid><dc:creator><![CDATA[info-creaticode]]></dc:creator><pubDate>Thu, 30 Nov 2023 04:41:47 GMT</pubDate></item><item><title><![CDATA[Reply to Key pressed bug on Wed, 29 Nov 2023 18:09:23 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/tyller_" aria-label="Profile: Tyller_">@<bdi>Tyller_</bdi></a></p>
<p dir="auto">That’s correct. Currently, the “key ( ) is pressed” block expects a string, so plugging in a variable causes it to fail. We will release a hotfix for it later today. Sorry about that.</p>
<p dir="auto">And joining the variable with an empty string would fix that issue for now.</p>
<p dir="auto">In addition, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ek43680-wdmcs" aria-label="Profile: ek43680-wdmcs">@<bdi>ek43680-wdmcs</bdi></a> , in your original code, the code is triggered by “when [any] key released” event, <strong>which needs to be changed to “when [any] key pressed”</strong>. That’s because the “when [any] key released” block runs when the key has been released already, so the “key () is pressed” block will not find any key in the “pressed” state.</p>
<p dir="auto">Here is the corrected program:</p>
<p dir="auto"><img src="https://cdn.creaticode.com/scratch-gui-projects/forum/e59c4482-b56f-4729-9a95-b6e33a89a2bb.png" alt="5f4e86a9-d47a-478b-8061-18e438add045-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"> <br />
Here is the project:</p>
<p dir="auto"><a href="https://play.creaticode.com/projects/65677a359037505e69aa1bed" target="_blank">https://play.creaticode.com/projects/65677a359037505e69aa1bed</a><br /> <br />
<iframe src="https://play.creaticode.com/projects/65677a359037505e69aa1bed/embed" width="485" height="402" frameborder="0" allowfullscreen></iframe></p>
]]></description><link>https://forum.creaticode.com/post/1156</link><guid isPermaLink="true">https://forum.creaticode.com/post/1156</guid><dc:creator><![CDATA[info-creaticode]]></dc:creator><pubDate>Wed, 29 Nov 2023 18:09:23 GMT</pubDate></item><item><title><![CDATA[Reply to Key pressed bug on Wed, 29 Nov 2023 16:45:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ek43680-wdmcs" aria-label="Profile: ek43680-wdmcs">@<bdi>ek43680-wdmcs</bdi></a> recreating it and dissecting, the issues appears to be the change variable by block sets the variable to a number value, the set makes it a string, the change var by block works with turning numbers that are currently a string to a number and increasing (a string is what a program lets be any text incase somebody reading doesn’t know), but it turns the variable output into a number, so any string inputs (I tried fixing it with uppercase/lowercase of text and it froze it running that alone) just freeze when given a forced number value (the variable after a change by block is ran is turned from a string into a number)</p>
<p dir="auto">As of typing I have found that the join block fixes this, so replace the lone # in the key # pressed block with a join (#) () block and it’ll work the exact way as it would of without the join but without freezing</p>
]]></description><link>https://forum.creaticode.com/post/1155</link><guid isPermaLink="true">https://forum.creaticode.com/post/1155</guid><dc:creator><![CDATA[Tyller_]]></dc:creator><pubDate>Wed, 29 Nov 2023 16:45:58 GMT</pubDate></item><item><title><![CDATA[Reply to Key pressed bug on Wed, 29 Nov 2023 16:29:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ek43680-wdmcs" aria-label="Profile: ek43680-wdmcs">@<bdi>ek43680-wdmcs</bdi></a> can you send a picture of the blocks? The get scripts for sprite is useful but doesn’t include stuff like parentheses for ordering</p>
]]></description><link>https://forum.creaticode.com/post/1154</link><guid isPermaLink="true">https://forum.creaticode.com/post/1154</guid><dc:creator><![CDATA[Tyller_]]></dc:creator><pubDate>Wed, 29 Nov 2023 16:29:07 GMT</pubDate></item></channel></rss>