Request: "Last Pressed" expression for keyboard

Discussion and feedback on Construct 2

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,127
Reputation: 8,095

Post » Sun Jan 03, 2016 2:24 pm

eli0s wrote:
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.

Aww and there I was thinking it was perfect :D What problems does it produce?
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Mon Jan 04, 2016 7:45 am

Zebbi wrote:Aww and there I was thinking it was perfect :D What problems does it produce?


Well, have you tried pressing "Shift", "Enter", "Ctrl", the arrow keys, any of the numpad keys...? Either nothing happens, or totally incorrect characters appear. There are also differences between browsers, in Firefox, pressing "Shift" produces a graphical element but on Edge and Chrome nothing happens.

I haven't checked it thoroughly, but the default "Keyboard" Plugin seems to be a lot more predictable and functional. It just doesn't register "Spacebar" as a string. But this can be easily implemented with an extra event.
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Mon Jan 04, 2016 7:57 am

eli0s wrote:
Zebbi wrote:Aww and there I was thinking it was perfect :D What problems does it produce?


Well, have you tried pressing "Shift", "Enter", "Ctrl", the arrow keys, any of the numpad keys...? Either nothing happens, or totally incorrect characters appear. There are also differences between browsers, in Firefox, pressing "Shift" produces a graphical element but on Edge and Chrome nothing happens.

I haven't checked it thoroughly, but the default "Keyboard" Plugin seems to be a lot more predictable and functional. It just doesn't register "Spacebar" as a string. But this can be easily implemented with an extra event.


How do you convert character codes to actual characters with the keyboard plugin?
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Mon Jan 04, 2016 4:34 pm

@Zebbi , my example above doesn't work for you? Or am I misinterpreting something, English isn't my strong suite! :shock:
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Mon Jan 04, 2016 5:46 pm

eli0s wrote:@Zebbi , my example above doesn't work for you? Or am I misinterpreting something, English isn't my strong suite! :shock:

Whoops, missed that! Thanks for that, I've replaced charcode with that (no need for extra plugins if not essential :D )
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Mon Jan 04, 2016 9:55 pm

@Zebbi , I agree with you, the official "Keyboard" plugin does the same thing better. If only it could register the "Spacebar"...

An other issue is that there isn't a way to differentiate the left Shift/Ctrl from the right. This is a restriction inherited from the browsers or something...

Anyway, keep it up!
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Tue Jan 05, 2016 3:06 pm

eli0s wrote:@Zebbi , I agree with you, the official "Keyboard" plugin does the same thing better. If only it could register the "Spacebar"...

An other issue is that there isn't a way to differentiate the left Shift/Ctrl from the right. This is a restriction inherited from the browsers or something...

Anyway, keep it up!

Fortunately, I only need characters and numberics, so it's not an issue, but it would be still nice to capture space bar from the keyboard plugin. Can't it be done at all with your method?
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Wed Jan 06, 2016 4:06 pm

@Zebbi , you can do it with an extra event. Here, I've updated the example to reflect this.
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, Elliott, R0J0hound and 13 guests