Skip to content

Conversation

@foxx1337
Copy link
Contributor

@foxx1337 foxx1337 commented Apr 7, 2020

This is just an "aesthetic" change, to use more modern code for detecting the states of the main modifiers.

Description

Makes use of the MOD_MASK_ macros instead of the expanded expressions when dealing with the modifier keys.

Others should be able to see this and incorporate it in their own Massdrop layouts. The old model was:

#define MODS_SHIFT  (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL  (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT  (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))

vs

#define MODS_SHIFT  (get_mods() & MOD_MASK_SHIFT)
#define MODS_CTRL   (get_mods() & MOD_MASK_CTRL)
#define MODS_ALT    (get_mods() & MOD_MASK_ALT)

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.
  • 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).

Suggested by @ash0x0 at #8692.

Copy link
Contributor

@vomindoraan vomindoraan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zvecr zvecr added the keymap label Apr 7, 2020
Copy link
Contributor

@ridingqwerty ridingqwerty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zvecr zvecr merged commit 061ed87 into qmk:master Apr 10, 2020
@zvecr
Copy link
Member

zvecr commented Apr 10, 2020

Thanks!

violet-fish pushed a commit to violet-fish/qmk_firmware that referenced this pull request Apr 12, 2020
Quarren42 pushed a commit to Quarren42/qmk_firmware that referenced this pull request Apr 15, 2020
kylekuj pushed a commit to kylekuj/qmk_firmware that referenced this pull request Apr 21, 2020
bitherder pushed a commit to bitherder/qmk_firmware that referenced this pull request May 15, 2020
sowbug pushed a commit to sowbug/qmk_firmware that referenced this pull request May 24, 2020
turky pushed a commit to turky/qmk_firmware that referenced this pull request Jun 13, 2020
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
thorstenweber83 pushed a commit to thorstenweber83/qmk_firmware that referenced this pull request Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants