]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - common/action_code.h
Fix action macros
[tmk_firmware.git] / common / action_code.h
index df6ce99986894b440b31dfabef489ed9d63fc38b..b2a7f2b4f761eb80398385b6b03043ba1828e2d5 100644 (file)
@@ -33,9 +33,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *   r: Left/Right flag(Left:0, Right:1)
  *
  * ACT_MODS_TAP(001r):
- * 0010|mods|0000 0000    Modifiers with OneShot
- * 0010|mods|0000 00xx    (reserved)
- * 0010|mods| keycode     Modifiers with Tap Key
+ * 001r|mods|0000 0000    Modifiers with OneShot
+ * 001r|mods|0000 00xx    (reserved)
+ * 001r|mods| keycode     Modifiers with Tap Key
  *
  *
  * Other Keys(01xx)
@@ -207,10 +207,10 @@ enum mods_codes {
     MODS_ONESHOT = 0x00,
 };
 #define ACTION_KEY(key)                 ACTION(ACT_MODS, (key))
-#define ACTION_MODS(mods)               ACTION(ACT_MODS, (mods)<<8 | 0)
-#define ACTION_MODS_KEY(mods, key)      ACTION(ACT_MODS, (mods)<<8 | (key))
-#define ACTION_MODS_TAP_KEY(mods, key)  ACTION(ACT_MODS_TAP, (mods)<<8 | (key))
-#define ACTION_MODS_ONESHOT(mods)       ACTION(ACT_MODS_TAP, (mods)<<8 | MODS_ONESHOT)
+#define ACTION_MODS(mods)               ACTION(ACT_MODS, (mods&0x1f)<<8 | 0)
+#define ACTION_MODS_KEY(mods, key)      ACTION(ACT_MODS, (mods&0x1f)<<8 | (key))
+#define ACTION_MODS_TAP_KEY(mods, key)  ACTION(ACT_MODS_TAP, (mods&0x1f)<<8 | (key))
+#define ACTION_MODS_ONESHOT(mods)       ACTION(ACT_MODS_TAP, (mods&0x1f)<<8 | MODS_ONESHOT)
 
 
 /*