Skip to content
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

Keycodes 0xB0-0xDD are not supported #684

Closed
tmk opened this issue May 25, 2021 · 1 comment
Closed

Keycodes 0xB0-0xDD are not supported #684

tmk opened this issue May 25, 2021 · 1 comment

Comments

@tmk
Copy link
Owner

tmk commented May 25, 2021

Keycodes 0xB0-0xDD(HID usages) including KP_00 and KP_000 are not supported with current firmware.

https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/keycode.h#L357-L402

0xA5-DF and 0xF0-FF are used for special purpose like media and mouse keys. This code range conflicts the HID usages(0xB0-DD).
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/keycode.h#L417-L483

With current implementation ACTION_KEY(0xB0) is translated to KC_MEDIA_PLAY_PAUSE, not KC_KP_00.

This patch changes this behaviour in reverse.

diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h
index 7ed711a4..e5773ac4 100644
--- a/tmk_core/common/keycode.h
+++ b/tmk_core/common/keycode.h
@@ -27,6 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define IS_ANY(code)             (KC_A         <= (code) && (code) <= 0xFF)
 
 // Use original HID usages on B0-DD instead of TMK specific codes
+#define USE_ORIGINAL_HID_USAGE
 #ifndef USE_ORIGINAL_HID_USAGE
 #define IS_KEY(code)             (KC_A         <= (code) && (code) <= KC_EXSEL)
 #else

register_code() and unregister_code() need to be changed, perhaps.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L418-L441

Also refer to this.
https://deskthority.net/viewtopic.php?p=487067#p487067

@tmk
Copy link
Owner Author

tmk commented May 26, 2021

I seems that the keycodes 0xB0-0xDD are not supported by Windows and Linux and not useful in fact.

Using the code ranges(0xA5-FF) for TMK internal special purpose would be reasonable and preferable for users.
In current implementation, they are actually used as keyocodes of media keys and mouse keys. I'll keep this current implementation and KP_00 and KP_000 are not supported by default.

If you want to send USB HID usage range (0xB0-DD) instead of media/mouse keys define USE_ORIGINAL_HID_USAGE in config.h.

It may be useful to define builtin macro for the 00 and 000 on specific keyboard like IBM 4704 keyboards.
https://geekhack.org/index.php?topic=54706.0

@tmk tmk closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant