I'm using a french keyboard (azerty layout). Now that the hotbar can finally be used thanks to the new keybinding menu, I changed controls to fit my keyboard. But some keys are displayed as "NONE" in the menu and do not work correctly in game.
&, é,", (, è, ç are reported as "NONE"
', -, _ work fine
When pressing one of the NONE key, the game switch to the last slot (bound to ç). I guess the game consider all these keys to be the same and use the last action bound to this key.
Some other keys have the same issue but I cannot be exhaustive :
), $, *, ^, ù, !, <
^ is a dead key and must be typed twice.
Related issues
relates to
Comments


This seems related with this issue from LWJGL : http://lwjgl.org/forum/index.php?topic=3950.0

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

I can confirm this problem using Minecraft 1.7.4 / Launcher version 1.3.7 but not with the french/belgian keyboard, instead I've got this problem on a german keyboard with the keys:
ö, ä, ü, #, +, ß, ', ^ and <.
I tested this manually, for these keys LWJGL doesn't output any KeyCode, and I even investigated LWJGL's java source:
The problem is neither in Minecraft nor in the Java-part of LWJGL, instead it has to be anywhere between the Kernel and LWJGL's C parts.

This is IMHO a bug in minecraft that also affects the windows version.
The lwjgl bugtracker tells why: https://github.com/LWJGL/lwjgl/issues/59
Edit: Bug still present in Minecraft 1.7.4 with launcher 1.3.7.

I've created a fix for everyone using forge in 1.6.4, the same changes could be applied to vanilla minecraft.
src.minecraft.client.settings.GameSettings.java
// Replace getKeyDisplayString with this one:
public static String getKeyDisplayString(int key) {
// I've replace the original ternary operator here with a regular if clause for better readibility
if (key < 0) {
return I18n.getStringParams("key.mouseButton",
new Object[] { Integer.valueOf(key + 101) });
} else if (Keyboard.getKeyName(key)==null || Keyboard.getKeyName(key).isEmpty() || Keyboard.getKeyName(key).equals("NONE")) {
return String.format("%c", key).toUpperCase();
} else {
return Keyboard.getKeyName(key);
}
}
src.cpw.mods.fml.client.registry.KeyBindingRegistry.java
// Add this Method
public static final List<Integer> getPressedKeys() {
List<Integer> pressedKeys = new ArrayList<Integer>();
while (Keyboard.next()) {
pressedKeys.add(Keyboard.getEventKey() != Keyboard.KEY_NONE ? Keyboard.getEventKey() : Keyboard.getEventCharacter());
}
return pressedKeys;
}
// Replace keyTick with this one
private void keyTick(EnumSet<TickType> type, boolean tickEnd)
{
List<Integer> pressedKeys = getPressedKeys();
for (int i = 0; i < keyBindings.length; i++)
{
KeyBinding keyBinding = keyBindings[i];
int keyCode = keyBinding.keyCode;
boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : pressedKeys.contains(keyCode));
if (state != keyDown[i] || (state && repeatings[i]))
{
if (state)
{
keyDown(type, keyBinding, tickEnd, state!=keyDown[i]);
}
else
{
keyUp(type, keyBinding, tickEnd);
}
if (tickEnd)
{
keyDown[i] = state;
}
}
}
}
src.net.minecraftforge.client.GuiControlsScrollPanel.java
// Replace keyTyped with this one
public boolean keyTyped(char c, int i)
{
if (selected != -1)
{
if (i != 0)
options.setKeyBinding(selected, i);
else
options.setKeyBinding(selected, c);
selected = -1;
KeyBinding.resetKeyBindingArrayAndHash();
return false;
}
return true;
}
net.minecraft.client.Minecraft.java
while (Keyboard.next())
{
KeyBinding.setKeyBindState(Keyboard.getEventKey() != Keyboard.KEY_NONE ? Keyboard.getEventKey() : Keyboard.getEventCharacter(), Keyboard.getEventKeyState());
if (Keyboard.getEventKeyState())
{
KeyBinding.onTick(Keyboard.getEventKey() != Keyboard.KEY_NONE ? Keyboard.getEventKey() : Keyboard.getEventCharacter());
}
if (this.field_83002_am > 0L)
{
if (getSystemTime() - this.field_83002_am >= 6000L)
{
throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
}
if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61))
{
this.field_83002_am = -1L;
}
}
else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61))
{
this.field_83002_am = getSystemTime();
}
if (Keyboard.getEventKeyState())
{
if (Keyboard.getEventKey() == 87)
{
this.toggleFullscreen();
}
else
{
if (this.currentScreen != null)
{
this.currentScreen.handleKeyboardInput();
}
else
{
if (Keyboard.getEventKey() == 1)
{
this.displayInGameMenu();
}
if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61))
{
this.refreshResources();
}
if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61))
{
this.refreshResources();
}
if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61))
{
flag = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54);
this.gameSettings.setOptionValue(EnumOptions.RENDER_DISTANCE, flag ? -1 : 1);
}
if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61))
{
this.renderGlobal.loadRenderers();
}
if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61))
{
this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips;
this.gameSettings.saveOptions();
}
if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61))
{
RenderManager.field_85095_o = !RenderManager.field_85095_o;
}
if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61))
{
this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus;
this.gameSettings.saveOptions();
}
if (Keyboard.getEventKey() == 59)
{
this.gameSettings.hideGUI = !this.gameSettings.hideGUI;
}
if (Keyboard.getEventKey() == 61)
{
this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo;
this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown();
}
if (Keyboard.getEventKey() == 63)
{
++this.gameSettings.thirdPersonView;
if (this.gameSettings.thirdPersonView > 2)
{
this.gameSettings.thirdPersonView = 0;
}
}
if (Keyboard.getEventKey() == 66)
{
this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera;
}
}
for (i = 0; i < 9; ++i)
{
if (Keyboard.getEventKey() == 2 + i)
{
this.thePlayer.inventory.currentItem = i;
}
}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart)
{
if (Keyboard.getEventKey() == 11)
{
this.updateDebugProfilerName(0);
}
for (i = 0; i < 9; ++i)
{
if (Keyboard.getEventKey() == 2 + i)
{
this.updateDebugProfilerName(i + 1);
}
}
}
}
}
}
This should be enough to fix the problem for forge users.
Mojang, please implement this!

Still a concern in 14w08a.
Also note that the characters cited here correspond to only three keyboard layouts, from only three language, and only for the numeric keys of the keyboard. It can almost be anything depending on that layout, and there is at least a dozen of layouts for every language, and the player is actually free to bind keys which aren't even amongst the numeric ones.
To put it simply, the game needs to support any possible character, not only ASCII ones.

I use QWERTY, Swedish keyboard layout. Is this related to the actual keyboard layout? I thought it was just binding "special keys" on GNU/Linux.
Is there, on GNU/Linux, keyboard layouts that works correctly?

Oh, you're right, the game doesn't actually bind char codes but key codes to the control, therefore not changing depending on your layout (which is also a problem, in my opinion. If I have a qwerty layout on my azerty keyboard, I expect the game, as any other software, to recognise the qwerty layout. But it's a problem that many game engines share so I'm pretty sure it's way harder to fix than it seems, and since Minecraft allows us to rebind the keys, it's not even needed. But I digress.) So, my bad, that's not a layout problem.
However, those layouts are based on real keyboard configurations, so it's pretty much the same. There has to be other keyboards than the three cited here.

OK, so I tested something. I use "setxkbmap se", which makes the key bind to NONE when I try to bind "special keys". If I run "setxkbmap us", to change to US keyboard layout, the keymapping works as intended. It works. The problem is certain keyboard layouts, like Swedish or Danish which also tried.. Not sure how to solve that... :/

I also have this problem on 1.7.9.
Linux as on Windows, when I press an "eccentric" key (é, è, ê, etc.), The key is recognized as NONE.
On Linux, the key does not then simply works.
Windows and all the "eccentric" keys are considered by the game as identical (eg é and è are the same).
I've played around with this today, the snapshot might have a 'fix' for the miss behavior. It will still name some keys wrongly though.

14w34c looks good here on Linux with german umlauts. It is now possible to bind those keys and the displayed name is correct.
Thanks! (Fun fact: there is another minecraft linux bug where LWJGL has been blamed initially: MC-55045)

14w34c fixes it for my french keyboard. Key names are correct (it is better than Windows on that point, now).
There is still a problem with the dead key ^: I have to press it twice, both in the option menu and in game.
I have no idea what you mean with 'dead key ^:'.
Right now if there was no eventKey given by LWJGL we use the character code generated. These are absolutely not unique (in other words, they might change when you hold modifier keys) but it's about the best that can be done.

A dead key is a key that does not write a character, but it modifies the next character. For example typing ^, then e, writes ê.
I don't really know lwjgl works, but I think it should be handled with a key code rather than a character code. Like the modifier keys (ctrl, alt, shift, ...) do not have associated characters but work fine.
Also, while in game, pressing ^ change the behaviour of the next non-modifier key :
– for actions that last for the time the key is pressed (like moving), the action starts with a delay (waiting for a repeat event ?).
– for other actions (quick slot, inventory, ...), the action is completely ignored.
It may come from a limitation of lwjgl as I have seen a lot of software having issues with this key.

It looks like a lwjgl bug. I wrote a short test program :
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
public class KeyboardTest {
public static void main (String[] args) {
try {
Display.setDisplayMode (new DisplayMode (800, 600));
Display.create ();
}
catch (LWJGLException e) {
e.printStackTrace ();
System.exit (0);
}
while (!Display.isCloseRequested ()) {
while (Keyboard.next ()) {
String state;
if (Keyboard.getEventKeyState ())
state = "pressed";
else
state = "released";
int key = Keyboard.getEventKey ();
System.out.println (Keyboard.getKeyName (key) + " (" + key + ") " + state);
}
Display.update ();
}
Display.destroy ();
}
}
Pressing ^ twice, gives the output:
CIRCUMFLEX (144) released
NONE (0) pressed
CIRCUMFLEX (144) released
Edit: This method outputs NONE key for the key I reported in the first message. Now, I understand what you mean by "no eventKey given by LWJGL".
Edit2: I posted a bug report on the LWJGL forum : http://lwjgl.org/forum/index.php/topic,5477.msg28937.html
I have the same problem with a Belgian (azerty) keyboard on Linux Ubuntu (not tested on Windows).
When we use the number keys above the letters, by default, symbols are printed instead of numbers (it's a normal behaviour for azerty keyboards).
To actually print a number, we have to press SHIFT (it works in Minecraft, but also triggers the action assigned to SHIFT).
The symbols for these keys on a Belgian keyboard are (from 1 to 0) : &, é, ", ', (, §, è, !, ç, à
Except for the apostrophe, trying to use these keys in the configuration menu returns "NONE".
Except for the §, all these keys work in the chat.