# How do I ask the user to input a string?

**URL:** <https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939>\
**Category:** Arcade\
**Created:** [December 23, 2019, 4:29am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939 "2019-12-23T04:29:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)\
**Post date:** [December 23, 2019, 4:29am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939/1 "2019-12-23T04:29:35Z")

</div>

Hi! I am currently developing a Keyboard simulator for my video game, and I am stuck.

I need to ask the user for their name, but I don’t quite know how …

Could anyone help me? I am also using the default Keyboard simulator for this task 🙂

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [December 23, 2019, 4:35am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939/2 "2019-12-23T04:35:29Z")

</div>

In the purple ‘game’ category, under prompt, theres a block ‘ask for string’ that accepts a strring for the prompt (e.g. “whats your name?”) and gives you the response. You can store this in a variable (“set myText to …”) to use it later

---

<div class="post-metadata">

**Author:** ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)\
**Post date:** [December 23, 2019, 4:56am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939/3 "2019-12-23T04:56:38Z")

</div>

I partly understand your answer 🙂

I found the ‘ask for string’ block, but I don’t know how to give the user control to be able to respond …

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [December 23, 2019, 5:31am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939/4 "2019-12-23T05:31:57Z")

</div>

The ask for string should give them the opportunity to respond; for example, [this program](https://makecode.com/_gaR6eEiJH6rk) asks for the users name and shows it back to them:

![2019-12-22 21.31.10](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/65e5fff00a88710ca2bc1f9bcb7862a5a3e0e2c3.gif)

---

<div class="post-metadata">

**Author:** ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)\
**Post date:** [December 23, 2019, 5:39am UTC](https://forum.makecode.com/t/how-do-i-ask-the-user-to-input-a-string/939/5 "2019-12-23T05:39:56Z")

</div>

Thank you! This is great! 🙂
