Skip to content

Converters should use hook_keyboard_leds_change() #665

@tmk

Description

@tmk

instead of keyboard_set_leds() or led_set() to allow users to replace default behaviour of lock key indicators.

ibmpc_usb patch for example

iff --git a/converter/ibmpc_usb/ibmpc_usb.c b/converter/ibmpc_usb/ibmpc_usb.c
index 6d22ad73..ac6defd2 100644
--- a/converter/ibmpc_usb/ibmpc_usb.c
+++ b/converter/ibmpc_usb/ibmpc_usb.c
@@ -26,6 +26,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "matrix.h"
 #include "timer.h"
 #include "action.h"
+#include "hook.h"
 #include "ibmpc_usb.h"
 #include "ibmpc.h"
 
@@ -323,6 +324,7 @@ uint8_t matrix_scan(void)
                     break;
                 case PC_AT:
                     led_set(host_keyboard_leds());
+                    //hook_keyboard_leds_change(host_keyboard_leds());
                     break;
                 case PC_AT_Z150:
                     // TODO: do not set indicators temporarily for debug
@@ -332,6 +334,7 @@ uint8_t matrix_scan(void)
                     ibmpc_host_send(0xF8);
                     // This should not be harmful
                     led_set(host_keyboard_leds());
+                    //hook_keyboard_leds_change(host_keyboard_leds());
                     break;
                 default:
                     break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions