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

Fix Command feature: use get_mods() instead of keyboard_report->mods #4955

Merged
merged 5 commits into from
Jan 27, 2019

Conversation

vomindoraan
Copy link
Contributor

@vomindoraan vomindoraan commented Jan 27, 2019

Description

As discussed in #4838, the Command feature doesn't work when NKRO is turned on since the keyboard report structure is different. get_mods() is the proper way to retrieve mod state. See issue for further details.

I've only replaced occurrences of keyboard_report->mods in IS_COMMAND definitions and Massdrop keyboard code (as per @patrickmt's comment on the issue). It's likely that other occurrences in keyboard code and user keymaps can be replaced as well, but I didn't want to do that in this PR as it could require more extensive testing.

Additionally, I removed an unnecessary IS_COMMAND redefinition in keyboards/clueboard/66/rev4/config.h which we missed in #4301.

Thanks @fauxpark for helping me figure out what was causing the problems with Command!

Based on #4301. Closes #4838.

Types of changes

  • Core
  • Bugfix
  • New Feature
  • Enhancement/Optimization
  • Keyboard (addition or update)
  • Keymap/Layout/Userspace (addition or update)
  • Documentation

Issues Fixed or Closed by this PR

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document. (https://docs.qmk.fm/#/contributing)
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna
Copy link
Member

drashna commented Jan 27, 2019

I think that eventually or soon, that we should implement a get_all_mods check, that returns the combined form, so this is more "accurate", and functions more like the old method (pre endpoint overhaul).

@drashna
Copy link
Member

drashna commented Jan 27, 2019

Thanks!

@drashna drashna merged commit 4d9b11a into qmk:master Jan 27, 2019
Shinichi-Ohki added a commit to Shinichi-Ohki/qmk_firmware that referenced this pull request Jan 27, 2019
* 'master' of https://github.com/qmk/qmk_firmware:
  Fix Command feature: use get_mods() instead of keyboard_report->mods (qmk#4955)
  [Keymap] Small improvements to Maxr1998's Contra keymap (qmk#4952)
  [Keymap] Minor updates to my dz60 keymap (qmk#4943)
  [Keyboard] UniGo66 keyboard added (qmk#4913)
  [Keymap] Move Iris via support to Via keymap (qmk#4893)
  Adds a default value for IS_COMMAND for COMMAND feature (qmk#4301)
  [Keyboard] drop unused i2c files (qmk#4948)
  [Keymap] Add Maxim keymap for Fourier (qmk#4534)
  use built-in arm stuff
  [Keymap] Add userspace files for vosechu (qmk#4912)
@vomindoraan
Copy link
Contributor Author

@drashna I totally agree! In fact, that's what I'm planning on doing next (right after replacing user-defined mod masks with the new standard ones).

zer09 pushed a commit to zer09/qmk_firmware that referenced this pull request Feb 9, 2019
…mk#4955)

* Remove unnecessary IS_COMMAND definition in clueboard/66/rev4

* Replace keyboard_report->mods with get_mods() in IS_COMMAND definitions

* Update docs to use get_mods() instead of keyboard_report->mods

* Replace keyboard_report->mods with get_mods() in tmk_core/protocol/usb_hid/test

For some reason, this occurrence used KB_LSHIFT and KB_RSHIFT, which don't exist

* Replace keyboard_report->mods with get_mods() in Massdrop keyboards (as per @patrickmt)
@vomindoraan vomindoraan deleted the command_get_mods branch February 18, 2019 03:08
dlhextall pushed a commit to dlhextall/qmk_firmware that referenced this pull request May 24, 2019
…mk#4955)

* Remove unnecessary IS_COMMAND definition in clueboard/66/rev4

* Replace keyboard_report->mods with get_mods() in IS_COMMAND definitions

* Update docs to use get_mods() instead of keyboard_report->mods

* Replace keyboard_report->mods with get_mods() in tmk_core/protocol/usb_hid/test

For some reason, this occurrence used KB_LSHIFT and KB_RSHIFT, which don't exist

* Replace keyboard_report->mods with get_mods() in Massdrop keyboards (as per @patrickmt)
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

Successfully merging this pull request may close these issues.

Command feature not working since single HID endpoint was introduced
2 participants