Log In  

0

Today i fixed a keyboard issue for PICO-8 running on a rpi3 B + raspbian(2016-05-27).

I use a German keyboard and the "<>" keys weren't displayed neither in console nor in code editor.
This occured with the static linked pico8 binary. ( pico8_dyn seems to work with the sdl version installed here, but runs to slow to be usable in my setup.)

As far as i understand it, it has to do with the keyboard handling of SDL. SDL seems to drop unknown keycodes.
I could observe an error message like:

INFO: The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <[email protected]> EVDEV KeyCode 86

Creating a custom xmodmap file did not work. My custom keyboard mappings weren't recognised. So i tried to handle it a level closer to the keyboard and created a custom xkb mapping.

I copied the current used layout

cp /usr/share/X11/xkb/symbols/de /usr/share/X11/xkb/symbols/de_pi

Modified de_pi so that less and greater were printed by pressing AltGr+x and AltGr+v:

 ...
    key <AB02>    { [         x,          X,        less,    U2039    ] };
    key <AB04>    { [         v,          V,   greater, singlelowquotemark ]  };
 ...

Registered the new layout in /usr/share/X11/xkb/rules/xfree86.lst

...
  de              German
  de_pi           German (PICO-8)
  gr              Greek
...

Enabled it in /etc/default/keyboard

XKBMODEL="pc105"
XKBLAYOUT="de_pi"
XKBVARIANT=""
XKBOPTIONS=""

And after restarting the raspberry pi. < and > can be used in PICO-8.
Put this here. May be someone find it usefull

raspberry
P#32475 2016-11-14 18:33

::

Hm, with the current release (0.1.10) my solution seems to be broken, as there is now a hard coded US layout.

Does anyone know a way to change this layout?

Otherwise i think i have to write a complete own raspi/pico-8 xkb mapping for my german keyboards.

P#34450 2016-12-29 15:31

::

"The mapped keyboard events for text input (SDL_TEXTINPUT) also seems to be broken for some raspis (so far observed on 2nd generation units), so 0.1.10 now detects if this is happening and uses a hard-coded US layout based on keydown events instead."

For me it might be enough to suppress this error detection and use the "broken" text input solution. My be there is an option or flag to avoid this fallback?

P#34451 2016-12-29 15:57

::

I have the same problem on raspberry 2 and 3 regarding french keyboard ( which works well in the bash console ) .
I was thinking of patching my sdl "dirtily".

As far as I can remember ( I build sdl2.0.3 projects on raspi 1b , 2 and 3 ), the keymap has always appeared as us in my sdl apps , regardless of my raspi settings ( various raspbians over the years ) .

P#38451 2017-03-20 11:36

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2017-06-24 01:52 | 0.177s | 1572k | Q:13