So I setup my PiTopSeed (Raspberry Pi Desktop solution) tonight and got the latest version of Pico-8 on it. I'm running into an issue with Pico-8 1.11B where after entering the editor, all the letter keys on my keyboard stop working. Function keys such as F1, Escape, Enter, Ctrl+Q to quick work just fine still. It all works initially, then after performing some actions, all the letter keys stop doing anything.
To Repro:
-Launch Pico-8
-See the keyboard working by just typing stuff in
-Press escape to enter the editor
-Press some keys in the code editor so you can see input is being taken
-Press Ctrl+F (to find)
-Press Enter
Now none of the letter or number keys input any data.
Link to my twitter showing me doing this:
https://twitter.com/MasterHyjinx/status/926730555688935424
Mac version seems to be ok. I imagine that this could be something to do with the CeedOS (which I think is just a custom Jessie build)
I downloaded my 1.10c version off of humble bundle and it seems like this bug does not occur on this version with my setup. Can anyone verify?
Hey MasterHyjinx, do you have this setup to load PICO-8 automatically? I've noticed on the Raspberry Pi, when I have it setup to launch automatically, my keyboard input is still going to the console (resulting in tons of failed logins). If I quit and launch it again from the command line, it works just fine. Not this if that's applicable for your setup, but hope it helps!
It also may just be an issue with 0.1.11b raspi version, but my issue was related to the console, so it occurred regardless of version. I'll test the latest version when I can.
For the record - I am having the disappearing text / keys issue as well on my Raspberry Pi 2 with the September version of Raspbian and the 0.1.11B version.
@eth3real I am not launching it on startup. I am seeing the issue that has been posted here where if you launch Pico-8, it seems that input goes through pico-8 into the OS and sometimes when I hit enter, I launch a second copy of Pico-8. Sometimes resulting in a crash where when I shutdown the second or first copy, my pi is locked. I reverted back to 1.10C and still get the issue where input falls through Pico-8 into the OS. Is this a raspian issue? I am using the Pi-Top flavor of Raspian
Thanks for checking it out @dspva. Good to know it is reproducible on Raspian.
I've uploaded 0.1.11c2 (note: it still boots as "0.1.11c") to the downloads section and to Humble Bundle, which will hopefully address this issue. If you need to confirm you have the right version, check pico8.txt.
SDL has some event focus issues running under Raspbian, and I haven't been able to track them down at the root but rather added some work-arounds:
- CTRL-C and CTRL-Z signals are trapped
- Keypress events are emulated using a US keyboard layout from keystate data (that works regardless of focus)
- On exit, any keypresses waiting to be dumped to console are consumed
I'd recommend running PICO-8 from commandline, or double clicking it and choosing "Run in Terminal", as some mouse and key events still seem to be transferred to the desktop otherwise.
Another related bug fix: entering notes in the SFX tracker would add two notes for each keypress.
C source code for the work-arounds, for any SDL2 programmers googling this issue:
// work arounds raspi sdl2 focus issues // Call terminal_init() before initializing SDL, and then terminal_exit() last thing before exiting // to restore the terminal properties. #include <stdio.h> #include <termios.h> #include <signal.h> #include <string.h> #include <stdbool.h> #include <stdlib.h> #include <unistd.h> void dummy_handler() { } static struct termios cooked, raw; void terminal_init() { signal(SIGINT, dummy_handler); // CTRL-C signal(SIGTSTP, dummy_handler); // CTRL-Z (void) tcgetattr(0, &cooked); (void) memcpy(&raw, &cooked, sizeof(struct termios)); raw.c_lflag &=~ (ICANON | ECHO); (void) tcsetattr(0, TCSANOW, &raw); } void terminal_exit() { fd_set set; struct timeval timeout; int result = 0; int done = 0; char c; int safety = 0; // Initialize the file descriptor set. FD_ZERO (&set); FD_SET (STDIN_FILENO, &set); // Initialize the timeout data structure. timeout.tv_sec = 0; timeout.tv_usec = 0; while (!done && safety++ < 65536*256) { // select returns 0 if timeout, 1 if input available, -1 if error result = select (FD_SETSIZE, &set, NULL, NULL, &timeout); if (result == 1) { c = getchar(); //printf("[%d]\n", c); if (c == 255) done = 1; } else { // error or no input available: exit done = 1; } } (void) tcsetattr(0, TCSANOW, &cooked); } |
Thanks for posting an executable and the update zep! I looked through the code you posted and I hope it helps someone else working on Raspian using SDL. I've only used SDL once and it was with Windows, I'm assuming the bazillion flavors of linux distros often results in anomalies that isn't even worth solving. Thanks again.
Checked the executable out last night and it seemed to work well!
Same issue with me! I using the lates 0.1.12C on my Raspberry Pi 3 using PICOPIE boot from this guy: https://guillermoamaral.com/read/picopi/
btw: the display is not "raspi analog out composite video friendly" on CRT TV, the top and bottom text's line is out of top and bottom boundary of the screen. ASpect Ratio...overscan....hard to fix it...have no idea to fix it.
each time I hit the CTRL ou ALT keys, the characters stop responding and i can't type anything, as on code editor or console.
Same issue as BGelais above.
Running 0.1.12c
Boots fine, but as soon as I hit the control key, I lose all letters and numbers I try to type.
Same issue as Stobe and BGelais. Running v0.2.1b
https://guillermoamaral.com/read/picopi/
is a dead link but I got what I assume is the same code from here:
[Please log in to post a comment]