Tic-80: Keyboard Layout broken again! (0.80.0-dev)

Created on 28 Sep 2018  路  14Comments  路  Source: nesbox/TIC-80

I compiled a version of 0.80.0-dev for myself. While I see a significant performance boost compared to 0.70.6, I'm sad to see that the keyboard layout is broken - again!

I'm using a German QWERTZ keybaord. While Y and Z are correctly mapped, every symbol appears to be mapped to QWERTY.
In case it is relevant: I cloned and compiled this version 28.09.2018, 13:02 UTC.

Again, this problem did not appear in 0.60.3 or 0.70.6.
Please fix this issue. It will be impossible to use TIC-80 like this.

keyboard android

Most helpful comment

fixed here e4bbc1d

All 14 comments

Yes, I added an ugly keyboard fix in 0.70.6 just to release build. The fix was removed in .80 and I'm thinking how to do it better...

BTW, why there are no "tasks to complete" in 0.80 milestone?

@JasonNumberThirteen will add tasks soon

We need it sooner. Its unusable for some people now!

I don't know if it's the same issue, but on azerty (French) keyboard, while 0.70 version is ok (azerty is ok and 123456 can be reached with the "shift" key), in 0.80 which I've compiled on linux, 123456 are directly accessible (without the shift modifier, like on qwerty), and some useful symbols, such as dot ("."), are not accessible at all.
Is it an SDL issue?

0.80.0-dev is unusable for Nordic keyboard layout, since basic symbols such as + or / are impossible to type. It also seems sokol version seems to have different layout to the default buggy one too.

@nesbox How could we help you to fix this issue? For my part I'm coding with an external editor, so it's rather OK, but when I need to save under a new name, there is no dot so I have to fiddle with setxkbmap to enter the proper name. Maybe https://github.com/nesbox/TIC-80/issues/889 would be the best to have a proper key layout.

@farvardin yes, you could setup keyboard/gamepad mapping with KEYCONFIG
we just need to implement it :)

would it be possible to reuse the previous KEYMAP command?

yes, but it worked with gamepad only, without keyboard support

This is an important bug for a lot of non-English people. I also can hardly use TIC-80 from Linux because the keyboard layout is incorrect (I use a Spanish keyboard). It's a pity, because TIC-80 is a very nice console but this is a real PITA while programming. It forces me be more focused on the keys location than in coding.

I'd like to add to this thread that this issue also affects the "playability" of the games on the website. It's difficult to use z when it's where you have the y, especially in combination with x (which is at the same location in en and de keyboard layouts) - for example: https://tic.computer/play?cart=1096
[edit]
I've just realised that it is not "wrong" on the website. To solve the problem of different keyboard layouts inside games (when buttons are not limited to x and y), the creators of the games should have the ability to get the keyboard layout code of the system it is running on - or the engine offers constants for position based keys for gameplay only (as opposed to writing code in the editor).

The best way to fix this is probably taking advantage (at least on SDL backend) of SDL_TextInputEvent, it neatly manages the keyboard layout for text input. However this will require handling console and code editor keyboard input differently, since it currently directly reads from tic_mem keyboard memory.

fixed here e4bbc1d

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frsgrn picture frsgrn  路  5Comments

Kozova1 picture Kozova1  路  4Comments

nesbox picture nesbox  路  5Comments

BraininaBowl picture BraininaBowl  路  3Comments

carlsmith picture carlsmith  路  6Comments