Request: "Last Pressed" expression for keyboard

Discussion and feedback on Construct 2

Post » Fri Nov 09, 2012 10:21 am

I'd like to request the addition of an expression for the keyboard plug-in which returns the last key pressed.

I'm recording my player's key-presses, and my current approach involves a different event for each key. This would be significantly easier if I could use the "on any key pressed" condition and then use a "last key pressed" expression to identify the key in question.


It might be too difficult to return some sort of reference or pointer but simply returning the name of the key would be sufficiently useful, as it should then be able to be passed as a parameter to the new function argument.
B
24
S
5
G
2
Posts: 104
Reputation: 3,136

Post » Fri Nov 09, 2012 1:58 pm

I'll see if I can add something like this for the next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Fri Nov 09, 2012 4:32 pm

I'd like to second this request.
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Sat Nov 10, 2012 2:38 am

Thank-you so much Ashley, and thank-you again for such a fantastic product with such a quick and regular update schedule! I wish more developers had your dedication and work-ethic!

I think this feature will be very useful for anyone wanting to record input as I'm doing or for implementing "combo" patterns as often seen in arcade-style fighting games.
B
24
S
5
G
2
Posts: 104
Reputation: 3,136

Post » Wed Nov 21, 2012 5:59 am

Just wanted to reply again to say thanks for getting to this -- and an equivalent for gamepad -- so quickly with the latest release!
B
24
S
5
G
2
Posts: 104
Reputation: 3,136

Post » Thu Nov 22, 2012 7:45 am

@Ahsley, Thank you so much for the custom input support, almost all the big features are in now! :D

1 additional expression would help though: get a key as character/text (based on keycode). This way I could show the player a string that says "Shift" rather than "Keycode 16".
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Jan 02, 2016 6:23 pm

alspal wrote:@Ahsley, Thank you so much for the custom input support, almost all the big features are in now! :D

1 additional expression would help though: get a key as character/text (based on keycode). This way I could show the player a string that says "Shift" rather than "Keycode 16".

I'd like to be able to take the last key pressed and instead of returning a keycode, it could return the actual letter typed. I this possible?
B
29
S
7
G
3
Posts: 568
Reputation: 4,283

Post » Sat Jan 02, 2016 7:46 pm

This could be a valid way to do it... Although, it seems like "Spacebar" doesn't return a string...

@Ashley, is this normal...?
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,125
Reputation: 8,091

Post » Sat Jan 02, 2016 8:14 pm

eli0s wrote:This could be a valid way to do it... Although, it seems like "Spacebar" doesn't return a string...

@Ashley, is this normal...?

I managed to do it well with this: https://dl.dropboxusercontent.com/u/364 ... arCode.zip
B
29
S
7
G
3
Posts: 568
Reputation: 4,283

Post » Sun Jan 03, 2016 10:19 am

Zebbi wrote:
eli0s wrote:This could be a valid way to do it... Although, it seems like "Spacebar" doesn't return a string...

@Ashley, is this normal...?

I managed to do it well with this: https://dl.dropboxusercontent.com/u/364 ... arCode.zip


This method with Kyatric's plugin does return a string for "spacebar", but it produces a lot of other problems, in my opinion of course.
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,125
Reputation: 8,091

Next

Return to Construct 2 General

Who is online

Users browsing this forum: DTernes, Yahoo [Bot] and 2 guests