]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Add NO_ACTION_KEYMAP config option
authortmk <nobody@nowhere>
Tue, 19 Mar 2013 15:56:54 +0000 (00:56 +0900)
committertmk <nobody@nowhere>
Tue, 19 Mar 2013 16:45:04 +0000 (01:45 +0900)
common/action.c
common/layer_switch.c
common/layer_switch.h
keyboard/gh60/config.h

index 51b11d1bc2cc7539b4971c9cc59b2ccc5e4d5bc2..3d81318a9c6f7fcd5ee43cf910b083b89cec22e7 100644 (file)
@@ -369,6 +369,7 @@ static void process_action(keyrecord_t *record)
             break;
 #endif
 
+#ifndef NO_ACTION_KEYMAP
         case ACT_KEYMAP:
             switch (action.layer.code) {
                 /* Keymap clear */
@@ -530,6 +531,7 @@ static void process_action(keyrecord_t *record)
                     break;
             }
             break;
+#endif
 
 #ifndef NO_ACTION_OVERLAY
         case ACT_OVERLAY:
index 815d1e5f28a5f605a92c4c052700d1d71d11a519..a5d426a899be33280159760af416f6a18a6fb3e4 100644 (file)
@@ -24,6 +24,7 @@ void default_layer_set(uint8_t layer)
 }
 
 
+#ifndef NO_ACTION_KEYMAP
 /* 
  * Keymap Layer (0-15)
  */
@@ -95,6 +96,7 @@ void keymap_debug(void)
 {
     debug_hex16(keymap_stat); debug("("); debug_dec(keymap_get_layer()); debug(")");
 }
+#endif
 
 
 
@@ -189,6 +191,7 @@ action_t layer_switch_get_action(key_t key)
     }
 #endif
 
+#ifndef NO_ACTION_KEYMAP
     /* keymap: top layer first */
     for (int8_t i = 15; i >= 0; i--) {
         if (keymap_stat & (1<<i)) {
@@ -198,6 +201,7 @@ action_t layer_switch_get_action(key_t key)
             }
         }
     }
+#endif
 
     /* default layer */
     action = action_for_key(default_layer, key);
index 5de6cb01c324921aa15583b455da8156ad9d10fd..eb4cf61ba36f8ab3db5f0e898faf92a4477d7620 100644 (file)
@@ -38,6 +38,7 @@ void default_layer_set(uint8_t layer);
 /*
  * Keymap Layer
  */
+#ifndef NO_ACTION_KEYMAP
 extern uint16_t keymap_stat;
 /* return current active layer */
 uint8_t keymap_get_layer(void);
@@ -52,6 +53,20 @@ void keymap_or(uint16_t stat);
 void keymap_and(uint16_t stat);
 void keymap_xor(uint16_t stat);
 void keymap_debug(void);
+#else
+#define keymap_stat             0
+#define keymap_get_layer()
+#define keymap_clear()
+#define keymap_set(stat)
+#define keymap_move(layer)
+#define keymap_on(layer)
+#define keymap_off(layer)
+#define keymap_invert(layer)
+#define keymap_or(stat)
+#define keymap_and(stat)
+#define keymap_xor(stat)
+#define keymap_debug()
+#endif
 
 
 /*
index 2e2387aa298c30437250f285c6bfa0285577ed7d..7da5c6bbffa6c18cf81c50ea7c292a0ce643bc32 100644 (file)
@@ -61,6 +61,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* disable print */
 //#define NO_PRINT
 
+#define NO_ACTION_KEYMAP
 #define NO_ACTION_OVERLAY
 #define NO_ACTION_TAPPING
 #define NO_ACTION_MACRO