Page 2 of 2

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Sun Jan 03, 2016 10:19 am
by eli0s
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.

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Sun Jan 03, 2016 2:24 pm
by Zebbi
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?

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Mon Jan 04, 2016 7:45 am
by eli0s
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.

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Mon Jan 04, 2016 7:57 am
by Zebbi
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?

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Mon Jan 04, 2016 4:34 pm
by eli0s
@Zebbi , my example above doesn't work for you? Or am I misinterpreting something, English isn't my strong suite! :shock:

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Mon Jan 04, 2016 5:46 pm
by Zebbi
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 )

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Mon Jan 04, 2016 9:55 pm
by eli0s
@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!

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Tue Jan 05, 2016 3:06 pm
by Zebbi
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?

Re: Request: "Last Pressed" expression for keyboard

PostPosted: Wed Jan 06, 2016 4:06 pm
by eli0s
@Zebbi , you can do it with an extra event. Here, I've updated the example to reflect this.