Plugin Request - left/right shift button detection

Looking to build a team or have a job to offer?

Post » Fri Oct 31, 2014 1:06 am

I'm trying to get the keyboard plugin to detect left/right shift button presses.


how-do-i-detect-left-shift-right-shift_t106884

This here says it can be done in Chrome:

http://stackoverflow.com/questions/2297 ... up-in-chro

This test here proves that, yes, keycode is 16 for both SHIFT keys, but Javascript *can* handle location via the constant DOM_KEY_LOCATION_ which can be "standard", "left", "right" or "numpad".

It's a javascript question, if only I knew how to modify the keyboard plugin to add this functionality:

( window.onkeydown = function(event)
{
var o = 'event = onkeydown, which = ' + event.which + ', location = ';

switch(event.location)
{
case KeyboardEvent.DOM_KEY_LOCATION_STANDARD: o += 'standard'; break;

case KeyboardEvent.DOM_KEY_LOCATION_NUMPAD: o += 'numpad'; break;

case KeyboardEvent.DOM_KEY_LOCATION_LEFT: o += 'left'; break;

case KeyboardEvent.DOM_KEY_LOCATION_RIGHT: o += 'right'; break;
}

)

I've built the game around "A" and "right cursor key" but my testers are complaining about accessibility.
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Sat Nov 01, 2014 8:11 pm

https://www.scirra.com/forum/plugin-locationkeyboard_t118462

Just wrote it :) :D, my first Plugin done ;D
B
4
Posts: 3
Reputation: 206

Post » Sat Nov 01, 2014 11:25 pm

You're incredible, thank you oopwngoo :))
B
28
S
12
G
4
Posts: 193
Reputation: 4,581


Return to Job Offers and Team Requests

Who is online

Users browsing this forum: No registered users and 0 guests