-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard Leds dont Work (Fix inside) #17
Comments
See some amendments posted in the Raspberry Pi forum based on your idea around the caps lock key |
Hoping this gets added real soon. Vital when using original amiga hardware with something like Keyrah. |
Caps lock is not working anymore since latest merge of tomB version, moreover previous version was messing the caps lock management in X11... hence currently i'm stuck here with no time for this... |
I had fixed the caps key working in my code for led status. Would you consider checking this out for a committ to the code? |
I don't mind giving it a go if I can get it compiled. There are some guys |
You can always propose, i will see... |
here is my mods to the pandora.cpp file (based off your latest commits) which allow the capslock key and led to function as they should. Mirrors the system capslock state upon startup also |
Hi n0rt0nthec4t, The caps lock now functions as expected but the LED doesn't light when enabled. Outside of the app, in command line, its lit when enabled. Any thoughts on FDD and HDD to scroll and num lock? |
Not sure why. The code I made only has the caps lock key/led working inside the emulator when running ie. it in the configure menu I posted a link in the uae4arm forum thread on raspberrypi.org which has the hdd / fdd code Tested on kernel 4.4.c |
I tested it on a fresh rasbian install with just the requirements for echo keycode 58 = Caps_Lock |sudo loadkeys - I can get caps and num lock LEDs to work in commandline, not the gui or I've just found the led code from the forum so will give that a go, cheers. On 28 August 2016 at 23:38, n0rt0nthec4t [email protected] wrote:
|
If running on kernel 4.4.x you'll need to include a new dev rule as per the below thread to allow the scroll lock LED to function I could never make the "echo key code 58 =..." work on the latest Debian releases. I did have to create a complete new keymap to allow the correct keys to work with my A600 UK keyboard via keyrah v2 interface Does using "setleds +L +caps" turn on the caps lock led and "setleds +L -caps" turn it off via the commandline? That is essential what my code is doing |
Yes, using setleds I can enable either the caps or num lock lights. and On 29 August 2016 at 08:50, n0rt0nthec4t [email protected] wrote:
|
Attached is mine (zipped) Correct, is placed in /etc/udev/rules.d Have you done a "udevadm control --reload-rules"? Didnt think I had to do anything more than that. |
Thanks.that got it working. :)
maybe there was a typo between your file and mine. I had done the reload
rules and rebooted (just the reload rules didnt enable this either) but it
looks like its all working now! Cheers!
|
This solution works fine if uae4arm is launched from within X11 (or with xinit), but it doesn't seem to work if launched from the console. Maybe it's related to the input method used (X11 vs fbcon), but I haven't had the time to find out where exactly this is happening. I tried using SDL input keys only, as is the case with the Android port, but it didn't seem to help in this case. Have you tested this from a console, outside of X11? |
Yes, i don't even use X11 on my install.. Boots straight into uae4arm... (raspbian jessie install with 4.4.x kernel) Thanks for the feedback, I'll see what more testing i can do,. |
Libretro. Solve crash on vita when emulating amiga 1200.
For making the Capslock LED working we need to modify the file "src/od-pandora/pandora.cpp"
Firs add those includes (need to put < > en the include name, if i use it, the text disapear here.
ifdef CAPSLOCK_DEBIAN_WORKAROUND
#include linux/kd.h
#include sys/ioctl.h
endif
After line 122 add the new var: static unsigned long kb_led_status;
the code looks like
ifdef CAPSLOCK_DEBIAN_WORKAROUND
static int capslock = 0;
static unsigned long kb_led_status;
endif
After line 942 add: if (iAmigaKeyCode == AK_CAPSLOCK) { ioctl(NULL, KDGETLED, &kb_led_status); kb_led_status |= LED_CAP; ioctl(NULL, KDSETLED, kb_led_status); }
the code looks like
ifdef CAPSLOCK_DEBIAN_WORKAROUND
endif
After line 1014 add: if (iAmigaKeyCode == AK_CAPSLOCK) { ioctl(NULL, KDGETLED, &kb_led_status); kb_led_status &= ~LED_CAP; ioctl(NULL, KDSETLED, kb_led_status); }
the code looks like
ifdef CAPSLOCK_DEBIAN_WORKAROUND
endif
With those changes, Capslock LED is working now.
For the FD & HD Leds we need to modify src/od-pandora/pandora_gui.cpp
(Same than the first, need to use < > in the names)
ifdef RASPBERRY
#include linux/kd.h
#include sys/ioctl.h
endif
Then in line 1347 modify the empty gui_led process, leaving it with this code:
void gui_led (int led, int on)
{
#ifdef RASPBERRY
static unsigned long kb_led_status;
endif
}
And then modify the next process after the line 1363 add this new "case" for the fd:
case LED_DF0:
case LED_DF1:
case LED_DF2:
case LED_DF3:
gui_led(LED_DF0,1);
break;
Inside the "case LED_HD" after the line 1371 add this line: gui_led(LED_HD,1);
the code looks like:
case LED_HD:
if (status == 0) {
hd_resetcounter--;
if (hd_resetcounter > 0)
return;
}
gui_data.hd = status;
hd_resetcounter = 2;
gui_led(LED_HD,1);
break;
And after the switch, add those lines to turn off the leds
gui_led(LED_HD,0);
gui_led(LED_DF0,0);
The gui_flicker_led must lokks like this:
void gui_flicker_led (int led, int unitnum, int status)
{
static int hd_resetcounter;
switch(led)
{
case -1: // Reset HD and CD
gui_data.hd = 0;
break;
}
gui_led(LED_HD,0);
gui_led(LED_DF0,0);
}
Whith this the leds will work.
One more thing, i changed the Mouse Swich & Menu keys to Alt-gr + F9 & Alt-gr + F10, for the peopple with the Keyrath and original Amiga Keyboard. (To return from the gui to the emulator, i left only F10).
Fixes.zip
(Idea taken from the n0rt0nthec4t code published in the Rasberry Pi Forum).
The text was updated successfully, but these errors were encountered: