Mapping the keyboard to its "code"

To Whom It May Concern,

I’m using jInput in relation to MATLAB, but because of the intrinsic difficulty with custom-coding in MATLAB, cannot create a “keyboard mapping” API ???.

I was wondering whetehr anybody on these forums had a link to a website which shows the mapping of the keyboard to the “numbers” as a result of:

hInputDevices=net.java.games.input.DefaultControllerEnvironment;
hInputController = hInputDevices.getControllers;
hKeyboard = hInputController(2);
hKeyboardComponent = hKeyboard.getComponents;

hKeyboardComponent(x);

My query is what, for example, would “x” be for the “Esc” key
Furthermore, what would “x” be for the “5” key
Et cetera

Obviously, this mapping is different from the standard ASCII which is why I’m having difficulty :-.

Have a magical day ;D!

Kind regards,
Jerry Shum.

Well I’ve matched some of it (I may still need help with “spacebar” et cetera):

%% Upper row

% key q
hQ = hKeyboardComponent(16);

% key w
hW = hKeyboardComponent(17);

% key e
hE = hKeyboardComponent(18);

% key r
hR = hKeyboardComponent(19);

% key t
hT = hKeyboardComponent(20);

% key y
hY = hKeyboardComponent(21);

% key u
hU = hKeyboardComponent(22);

% key i
hI = hKeyboardComponent(23);

% key o
hO = hKeyboardComponent(24);

% key p
hP = hKeyboardComponent(25);

%% middle row

% key a
hA = hKeyboardComponent(30);

% key s
hS = hKeyboardComponent(31);

% key d
hD = hKeyboardComponent(32);

% key f
hF = hKeyboardComponent(33);

% key g
hG = hKeyboardComponent(34);

% key h
hH = hKeyboardComponent(35);

% key j
hJ = hKeyboardComponent(36);

% key k
hK = hKeyboardComponent(37);

% key l
hL = hKeyboardComponent(38);

%% lower row

% key z
hZ = hKeyboardComponent(44);

% key x
hX = hKeyboardComponent(45);

% key c
hC = hKeyboardComponent(46);

% key v
hV = hKeyboardComponent(47);

% key b
hB = hKeyboardComponent(48);

% key n
hN = hKeyboardComponent(49);

% key m
hM = hKeyboardComponent(50);

Will update if can figure out the rest of the ASCII-like code to map the keyboard for jInput.

Hi

This isn’t something that I’ve come across before. JInput seems to have been used mainly for games to this point. Please carry on with your documentation and let us know if there is any support we can provide.

Thanks

Endolf