changeset 2:ef0cbe565d18 draft

- enable bootmagic full - add mac layer - add macros: USPC,DSPC
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 12 Feb 2019 11:26:56 +0900
parents 366930ab82c7
children 4bc0df3a6934
files keymap.c rules.mk
diffstat 2 files changed, 51 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/keymap.c	Tue Feb 12 10:36:38 2019 +0900
+++ b/keymap.c	Tue Feb 12 11:26:56 2019 +0900
@@ -22,6 +22,7 @@
 // Layer names don't all need to be of the same length, obviously, and you can also skip them
 // entirely and just use numbers.
 #define _QWERTY 0
+#define _MAC    1
 #define _LOWER 3
 #define _RAISE 4
 #define _ADJUST 16
@@ -37,6 +38,8 @@
   LTAB,
   RSPC,
   LSPC,
+  USPC,
+  DSPC,
   SSCR,
   SWIN,
   NAPP,
@@ -62,6 +65,7 @@
 #define KC_LVAD  RGB_VAD
 #define KC_LMOD  RGB_MOD
 #define KC_CTLTB CTL_T(KC_TAB)
+#define KC_CTLESC CTL_T(KC_ESC)
 #define KC_GUIEI GUI_T(KC_LANG2)
 #define KC_ALTKN ALT_T(KC_LANG1)
 
@@ -69,11 +73,15 @@
 #define KC_LTAB  LTAB
 #define KC_RSPC  RSPC
 #define KC_LSPC  LSPC
+#define KC_USPC  USPC
+#define KC_DSPC  DSPC
 #define KC_SSCR  SSCR
 #define KC_SWIN  SWIN
 #define KC_NAPP  NAPP
 #define KC_NWIN  NWIN
 
+
+
 #define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI)
 
 
@@ -86,6 +94,18 @@
   //|------+------+------+------+------+------|                |------+------+------+------+------+------|
        LSFT,     Z,     X,     C,     V,     B,                      N,     M,  COMM,   DOT,  SLSH,  RSFT,\
   //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
+                                  LOWER,   SPC,  LALT,      ENT,  BSPC, RAISE \
+                              //`--------------------'  `--------------------'
+  ),
+
+  [_MAC] = LAYOUT_kc( \
+  //,-----------------------------------------.                ,-----------------------------------------.
+        ESC,     Q,     W,     E,     R,     T,                      Y,     U,     I,     O,     P,  MINS,\
+  //|------+------+------+------+------+------|                |------+------+------+------+------+------|
+      CTLTB,     A,     S,     D,     F,     G,                      H,     J,     K,     L,  SCLN,  QUOT,\
+  //|------+------+------+------+------+------|                |------+------+------+------+------+------|
+       LSFT,     Z,     X,     C,     V,     B,                      N,     M,  COMM,   DOT,  SLSH,  RSFT,\
+  //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
                                   LOWER,   SPC,  LGUI,      ENT,  BSPC, RAISE \
                               //`--------------------'  `--------------------'
   ),
@@ -98,7 +118,7 @@
   //|------+------+------+------+------+------|                |------+------+------+------+------+------|
        LSFT,    F6,    F7,    F8,    F9,   F10,                   PGDN,  HOME,   END,   F11,   F12,  RSFT, \
   //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
-                                  LOWER,   SPC,  LGUI,      ENT,  BSPC, RAISE \
+                                  LOWER,   SPC,  LALT,      ENT,  BSPC, RAISE \
                               //`--------------------'  `--------------------'
   ),
 
@@ -110,21 +130,34 @@
   //|------+------+------+------+------+------|                |------+------+------+------+------+------|
        LSFT,   GRV,  TILD, XXXXX, XXXXX, XXXXX,                  XXXXX, XXXXX, XXXXX,  LBRC,  RBRC,  RSFT,\
   //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
-                                  LOWER,   SPC,  LGUI,      ENT,  BSPC, RAISE \
+                                  LOWER,   SPC,  LALT,      ENT,  BSPC, RAISE \
                               //`--------------------'  `--------------------'
   ),
 
   [_ADJUST] = LAYOUT_kc( \
   //,-----------------------------------------.                ,-----------------------------------------.
-        RST, XXXXX, XXXXX,  SSCR,  SWIN, XXXXX,                  XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,   RST,\
+        RST,  SSCR,  SWIN, XXXXX,  USPC, XXXXX,                  XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,   RST,\
   //|------+------+------+------+------+------|                |------+------+------+------+------+------|
       XXXXX,  LTAB,  RTAB,  LSPC,  RSPC,  NAPP,                  XXXXX,  MUTE,  VOLD,  VOLU, XXXXX, XXXXX,\
   //|------+------+------+------+------+------|                |------+------+------+------+------+------|
-      XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,  NWIN,                  XXXXX,  MRWD,  MPLY,  MFFD, XXXXX, XXXXX,\
+      XXXXX, XXXXX, XXXXX, XXXXX,  DSPC,  NWIN,                  XXXXX,  MRWD,  MPLY,  MFFD, XXXXX, XXXXX,\
   //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
-                                  LOWER,   SPC,  LGUI,      ENT,  BSPC, RAISE \
+                                  LOWER,   SPC,  LALT,      ENT,  BSPC, RAISE \
                               //`--------------------'  `--------------------'
   )
+#if 0
+  [_MAC] = LAYOUT_kc( \
+  //,-----------------------------------------.                ,-----------------------------------------.
+      _____, _____, _____, _____, _____, _____,                  _____, _____, _____, _____, _____, _____,\
+  //|------+------+------+------+------+------|                |------+------+------+------+------+------|
+      _____, _____, _____, _____, _____, _____,                  _____, _____, _____, _____, _____, _____,\
+  //|------+------+------+------+------+------|                |------+------+------+------+------+------|
+      _____, _____, _____, _____, _____, _____,                  _____, _____, _____, _____, _____, _____,\
+  //|------+------+------+------+------+------+------|  |------+------+------+------+------+------+------|
+                                  _____, _____,  LGUI,    _____, _____, _____,\
+                              //`--------------------'  `--------------------'
+  )
+#endif
 };
 
 int RGB_current_mode;
@@ -287,6 +320,18 @@
           SEND_STRING(SS_LCTRL(SS_TAP(X_LEFT)));
       }
       break;
+  case USPC:
+      //ctrl-up
+      if(record->event.pressed) {
+          SEND_STRING(SS_LCTRL(SS_TAP(X_UP)));
+      }
+      break;
+  case DSPC:
+      //ctrl-down
+      if(record->event.pressed) {
+          SEND_STRING(SS_LCTRL(SS_TAP(X_DOWN)));
+      }
+      break;
   case SSCR:
       //shift-cmd-3
       if(record->event.pressed) {
--- a/rules.mk	Tue Feb 12 10:36:38 2019 +0900
+++ b/rules.mk	Tue Feb 12 11:26:56 2019 +0900
@@ -3,7 +3,7 @@
 #   change to "no" to disable the options, or define them in the Makefile in
 #   the appropriate keymap folder that will get included automatically
 #
-BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+BOOTMAGIC_ENABLE = full     # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE = no        # Mouse keys(+4700)
 EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
 CONSOLE_ENABLE = no         # Console for debug(+400)