[Solved] - Retrieve pressed keyboard key ?

For questions about using Classic.

Post » Mon May 16, 2011 12:57 pm

Hi there,

Is there an update for the Keyboard plugin that would have an expression to let me retrieve the key that has been pressed ?

I want to trigger different events on each keyboard key and I don't really want to make a separate event for each. If I could do something like that:

On any key pressed
-Sprite: Value 'Letter'
-Equal to Keyboard.Key

..would trigger action on that sprite.

Thanks!
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Mon May 16, 2011 1:19 pm

The input system plug by sglorz should handle this.
[url:23k6rowi]http://www.scirra.com/forum/viewtopic.php?f=33&t=7511[/url:23k6rowi]

Also the Custom Controls plug by Lucid may work for it as well.
[url:23k6rowi]http://www.scirra.com/forum/viewtopic.php?f=2&t=4476&hilit=custom+controls[/url:23k6rowi]
Image Image
B
161
S
48
G
90
Posts: 7,348
Reputation: 66,751

Post » Mon May 16, 2011 1:56 pm

Well at first I thought that was it!

But whenever I want to retrieve the key name or the key code, I must provide either the key name of key code, there's no way to simply get pressed key.. :(
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Mon May 16, 2011 10:27 pm

Here is a way to check all 89 keys that the mouse keyboard offers:
http://dl.dropbox.com/u/5426011/example ... ressed.cap
B
79
S
24
G
54
Posts: 4,741
Reputation: 40,745

Post » Mon May 16, 2011 10:54 pm

Well, thank you!!! Exactly what I need.

Next time you have 5 minutes of free time I would appreciate if you could explain your little magic to me :P

Thanks a lot!!
B
6
S
2
G
1
Posts: 122
Reputation: 1,194


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest