Get Control Text?

SnakeKiller

  • Posts: 29
Is it possible to get or print the value of the control key assigned to the control name? Or is that too weird of a thing?

What I'm trying to do is create a user-friendly menu option where players can change the control keys.

JeffreyDriver

  • Posts: 2262
This thread touches on something slightly similar to capture key presses- http://community.stencyl.com/index.php/topic,51961.0.html

You can record the key presses into attributes then use the 'simulate key press' block.

SnakeKiller

  • Posts: 29
Thanks, I've seen and read those. I understand the Input events, but I want to do something different. On a created event, I want to get the character values as text so I can save/load the information, and display the keys on the menu screen from the start without having the player press any keys yet.

JeffreyDriver

  • Posts: 2262
See the basic code attached. It records the input to a list so that they can be recalled later, it also draws it to screen.

Use don't need to use a 'when created' block.

Global attributes (the purple blocks) can easily be referred to from within different scenes.

If you want to assign multiple keys, you need a way of keeping track which control the current key press is for. I'd do this by having a button on screen for each control input you need and use an attribute to keep track of the last clicked button, then when a key is pressed record it to the right location in a list

LIBERADO

  • *
  • Posts: 2720
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

SnakeKiller

  • Posts: 29
Thanks guys for the response. Sorry for my late response; it's been a very busy week for me. I'll take a look at what both of you shared. Thanks again! :)