-
-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
[Bug] NKRO distorts keymap on Drop CTRL board #23939
Comments
This was probably broken by #22267 — apparently the NKRO implementation for The ATSAM case was apparently the only one where #define NKRO_SHARED_EP
/* key report size(NKRO or boot mode) */
#if defined(NKRO_ENABLE)
# if defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS)
# include "protocol/usb_descriptor.h"
# define NKRO_REPORT_BITS (SHARED_EPSIZE - 2)
# elif defined(PROTOCOL_ARM_ATSAM)
# include "protocol/arm_atsam/usb/udi_device_epsize.h"
# define NKRO_REPORT_BITS (NKRO_EPSIZE - 1)
# undef NKRO_SHARED_EP
# undef MOUSE_SHARED_EP
# else
# error "NKRO not supported with this protocol"
# endif
#endif |
This seems to be what caused it. diff --git a/tmk_core/protocol/host.c b/tmk_core/protocol/host.c
index 732fbdc37d..d5d56fcec7 100644
--- a/tmk_core/protocol/host.c
+++ b/tmk_core/protocol/host.c
@@ -97,7 +97,9 @@ void host_keyboard_send(report_keyboard_t *report) {
void host_nkro_send(report_nkro_t *report) {
if (!driver) return;
+#ifdef NKRO_SHARED_EP
report->report_id = REPORT_ID_NKRO;
+#endif
(*driver->send_nkro)(report);
if (debug_keyboard) {
diff --git a/tmk_core/protocol/report.h b/tmk_core/protocol/report.h
index 0e4f6e9def..03acb3799e 100644
--- a/tmk_core/protocol/report.h
+++ b/tmk_core/protocol/report.h
@@ -133,8 +133,21 @@ enum desktop_usages {
};
// clang-format on
-
-#define NKRO_REPORT_BITS 30
+#if defined(PROTOCOL_ARM_ATSAM)
+# include "protocol/arm_atsam/usb/udi_device_epsize.h"
+# define NKRO_REPORT_BITS (NKRO_EPSIZE - 1)
+# undef NKRO_SHARED_EP
+# undef MOUSE_SHARED_EP
+#else
+# define NKRO_REPORT_BITS 30
+#endif
#ifdef KEYBOARD_SHARED_EP
# define KEYBOARD_REPORT_SIZE 9
@@ -178,7 +191,9 @@ typedef struct {
} PACKED report_keyboard_t;
typedef struct {
+#ifdef NKRO_SHARED_EP
uint8_t report_id;
+#endif
uint8_t mods;
uint8_t bits[NKRO_REPORT_BITS];
} PACKED report_nkro_t; With that at least NKRO works again, have not tried mouse emulation yet. But since qmk_firmware/tmk_core/protocol/host.c Lines 112 to 130 in 4864d5a
|
Describe the Bug
When enabling NKRO (via the QK_MAGIC_TOGGLE_NKRO or QK_MAGIC_NKRO_ON Magic Keycode) the keyboard keymap gets distorted.
For instance W types 5, X types K, \ toggles Caps lock (even though I have no Caps lock in my actual keymap!).
Disabling NKRO brings the keymap back to normal but C, I, and Backspace stop functioning and everything else is typed as if caps lock is enabled while not actually enabled (Pressing shift doesn't do anything).
Only a power cycle of the keyboard fixes this, as long as NKRO is off or not written to EEPROM before the power cycle.
Keyboard Used
massdrop/ctrl
Link to product page (if applicable)
https://drop.com/buy/drop-ctrl-mechanical-keyboard
Operating System
Arch Linux 64bit & NixOS 24.11 unstable
qmk doctor Output
Is AutoHotKey / Karabiner installed
Other keyboard-related software installed
None
Additional Context
I have recently upgraded my keyboards firmware from a 3 year old version (fd54992) to the latest commit. Everything worked fine with the old firmware.
My config is at https://github.com/Izumemori/qmk_userspace, but it also happens with the default keymap at commit 751fbd7.
The udev rules from the
qmk doctor
output shouldn't matter since I'm developing in a dev container.The text was updated successfully, but these errors were encountered: