Terasology/ModularComputers

Proper fix for #10 - better key/char handling for ComputerTerminalWidget

Opened this issue · 1 comments

At present the ComputerTerminalWidget class has char character = 'x'; // event.getKeyCharacter(); where it seemingly used to be we could get both the id for a given key and the character it represents from NUIKeyEvent - but now only the id is available. Just commented it out in #10 so that the module would compile.

An alternative method onCharEvent is available in UIWidget but while it then provides the char it does not obviously capture the id and make it available 🤔

Probably the solution is to either provide both on one of those methods or make an easy way to look up one from the other. @DarkWeird has shown interest in fixing this at some point, but it is low priority anyway since ModularComputers doesn't work well at the moment.

I suspect about the same issue may be true for https://github.com/Terasology/KComputers/blob/develop/src/main/java/org/terasology/kcomputers/rendering/nui/layers/ComputerDisplayWidget.java#L68 (haven't compile fixed, but doesn't work in normal cases anyway)