Problem with keyboard on Linux

Hello Armory community,

I just tested the ArmorySDK2102 on LinuxMint, with an AZERTY keyboard, and noticed that the keys “0,1,2,3,4,5,6,7,8,9” don’t work, nor the numpad.

I tested with this script:

trace(Input.getKeyboard().down(“Numpad0”));
trace(Input.getKeyboard().down(“Zero”));

both lines return “null”.

I tried with previous SDK, and it seems that the problem appeared with the ArmorySDK2010, (the numeral keys were working on the SDK 2009).

I couldn’t test it on windows.

Does anyone have the same Issue ?
Thanks.

Indeed i remember when using Canvas editor, the numpad does not works good in Linux. I suppose it is a Kha fault but the reason i don’t report anything regarding that is because i also have problems with numpad out Armory in all distros i had used until now… What about you?

You can see here that there is not a Numpad0 reference in the keyboard class. That is why the key is “ignored”. In the Kha key kodes you can see that numpad keys have the same “name” as the main keys.

	else if (key == KeyCode.Seven) return "7";
	else if (key == KeyCode.Numpad7) return "7";
1 Like

Hi knowledgenude,

You can see here that there is not a Numpad0 reference in the keyboard class .

You’re right. I change the script to:

trace(Input.getKeyboard().down("0"));

But it keeps returning “False” even when I’m hiting the Numpad 0 or the Zero keys on my keyboard…

I thought it was a Kha issue, so I tried to mess with iron.system.Input.hx and kha.input.KeyCode.hx and I found that changing values for the A,B,C,D,E,etc… keyCode doesn’t impact the compilation.
( Even if you delete ABCD keycode from the kha.input.Keycode.hx file, it can still compile , however changing the others key’s keyCode affects the compilation ).

Example looking into kha.input.KeyCode.hx

var Control = 17;
var Alt = 18;

swaping this values and “ctrl” becomes “alt”

var A = 65;
var B = 66;

swaping this values doesn’t change anything…

I don’t know much about Kha, but this seems a bot strange to me.

1 Like

I trought about wrong key codes, see here and here.

The key codes in Kha:

Numpad0 = 96
Numpad1 = 97
Numpad2 = 98
Numpad3 = 99
Numpad4 = 100
Numpad5 = 101
Numpad6 = 102
Numpad7 = 103
Numpad8 = 104
Numpad9 = 105

And in the another repo (the only place i found it :slight_smile:):

KP0 = 82
KP1 = 79
KP2 = 80
KP3 = 81
KP4 = 75
KP5 = 76
KP6 = 77
KP7 = 71
KP8 = 72
KP9 = 73

But i guess it is not the problem, because the other keys works and in Zui the numpad ‘3’ and ‘9’ also works (some keys are interpreted as arrows even without Ctrl+Shift+NumLock and others ignored). Probably It is something in Kha low level because of the numpad behavior in Zui editor, test it by yourself to see.