summaryrefslogtreecommitdiff
path: root/keyboards/planck/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/planck/keymaps')
-rw-r--r--keyboards/planck/keymaps/altgr/common/init.h11
-rw-r--r--keyboards/planck/keymaps/hiea/common/init.h11
-rw-r--r--keyboards/planck/keymaps/hieax/common/init.h11
-rw-r--r--keyboards/planck/keymaps/mwpeterson/keymap.c2
-rw-r--r--keyboards/planck/keymaps/rootiest/keymap.c2
-rw-r--r--keyboards/planck/keymaps/sdothum/common/init.h11
-rw-r--r--keyboards/planck/keymaps/vaire/keymap.c19
-rw-r--r--keyboards/planck/keymaps/zach/zach_common_functions.c60
8 files changed, 66 insertions, 61 deletions
diff --git a/keyboards/planck/keymaps/altgr/common/init.h b/keyboards/planck/keymaps/altgr/common/init.h
index 6366a19f65..6d0b4392fb 100644
--- a/keyboards/planck/keymaps/altgr/common/init.h
+++ b/keyboards/planck/keymaps/altgr/common/init.h
@@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- static uint8_t old_usb_led = 0;
+ static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}
#endif
diff --git a/keyboards/planck/keymaps/hiea/common/init.h b/keyboards/planck/keymaps/hiea/common/init.h
index 6366a19f65..6d0b4392fb 100644
--- a/keyboards/planck/keymaps/hiea/common/init.h
+++ b/keyboards/planck/keymaps/hiea/common/init.h
@@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- static uint8_t old_usb_led = 0;
+ static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}
#endif
diff --git a/keyboards/planck/keymaps/hieax/common/init.h b/keyboards/planck/keymaps/hieax/common/init.h
index 6366a19f65..6d0b4392fb 100644
--- a/keyboards/planck/keymaps/hieax/common/init.h
+++ b/keyboards/planck/keymaps/hieax/common/init.h
@@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- static uint8_t old_usb_led = 0;
+ static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}
#endif
diff --git a/keyboards/planck/keymaps/mwpeterson/keymap.c b/keyboards/planck/keymaps/mwpeterson/keymap.c
index 5871fe4bfe..065750434f 100644
--- a/keyboards/planck/keymaps/mwpeterson/keymap.c
+++ b/keyboards/planck/keymaps/mwpeterson/keymap.c
@@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LOWER_LAYER] = LAYOUT_planck_grid(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_3),
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
- _______, KC_MINS, KC_PLUS, KC_GRV, SFT_INS, KC_COLN, KC_PIPE, X(IBANG), KC_COMM, KC_DOT, KC_BSLS, _______,
+ _______, KC_MINS, KC_PLUS, KC_GRV, SFT_INS, KC_COLN, KC_PIPE, UM(IBANG), KC_COMM, KC_DOT, KC_BSLS, _______,
_______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______
),
diff --git a/keyboards/planck/keymaps/rootiest/keymap.c b/keyboards/planck/keymaps/rootiest/keymap.c
index 7e3b8af367..d6e8c7ef0f 100644
--- a/keyboards/planck/keymaps/rootiest/keymap.c
+++ b/keyboards/planck/keymaps/rootiest/keymap.c
@@ -1527,7 +1527,7 @@ void scap_finished(tap_dance_state_t* state, void* user_data) {
register_code(KC_LSFT);
break;
default:
- if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) {
+ if (host_keyboard_led_state().caps_lock) {
tap_code(KC_CAPS);
reset_tap_dance(state);
break;
diff --git a/keyboards/planck/keymaps/sdothum/common/init.h b/keyboards/planck/keymaps/sdothum/common/init.h
index 6366a19f65..6d0b4392fb 100644
--- a/keyboards/planck/keymaps/sdothum/common/init.h
+++ b/keyboards/planck/keymaps/sdothum/common/init.h
@@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- static uint8_t old_usb_led = 0;
+ static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
+ else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}
#endif
diff --git a/keyboards/planck/keymaps/vaire/keymap.c b/keyboards/planck/keymaps/vaire/keymap.c
index 05f7f4a520..f58486cda8 100644
--- a/keyboards/planck/keymaps/vaire/keymap.c
+++ b/keyboards/planck/keymaps/vaire/keymap.c
@@ -80,47 +80,48 @@ void matrix_init_user(void)
println("Matrix Init");
}
-void led_set_user(uint8_t usb_led)
+bool led_update_user(led_t led_state)
{
- static uint8_t old_usb_led = 0;
+ static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes())
{
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
+ if (led_state.caps_lock && !old_led_state.caps_lock)
{
// If CAPS LK LED is turning on...
PLAY_SONG(tone_caps_on);
}
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
+ else if (!led_state.caps_lock && old_led_state.caps_lock)
{
// If CAPS LK LED is turning off...
PLAY_SONG(tone_caps_off);
}
- else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ else if (led_state.num_lock && !old_led_state.num_lock)
{
// If NUM LK LED is turning on...
PLAY_SONG(tone_numlk_on);
}
- else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ else if (!led_state.num_lock && old_led_state.num_lock)
{
// If NUM LED is turning off...
PLAY_SONG(tone_numlk_off);
}
- else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ else if (led_state.scroll_lock && !old_led_state.scroll_lock)
{
// If SCROLL LK LED is turning on...
PLAY_SONG(tone_scroll_on);
}
- else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ else if (!led_state.scroll_lock && old_led_state.scroll_lock)
{
// If SCROLL LED is turning off...
PLAY_SONG(tone_scroll_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}
diff --git a/keyboards/planck/keymaps/zach/zach_common_functions.c b/keyboards/planck/keymaps/zach/zach_common_functions.c
index 6ad1c7bed3..ae5f44e713 100644
--- a/keyboards/planck/keymaps/zach/zach_common_functions.c
+++ b/keyboards/planck/keymaps/zach/zach_common_functions.c
@@ -141,31 +141,31 @@ tap_dance_action_t tap_dance_actions[] = {
//#ifdef UNICODE_ENABLE
// Unicode shortcuts
-#define IBANG X(0x203D)
-#define RAROW X(0x2192)
-#define LAROW X(0x2190)
-#define DEGREE X(0x00B0)
-#define OMEGA X(0x03A9)
-#define WOMEGA X(0x03C9)
-#define MICRO X(0x00B5)
-#define PLUMIN X(0x00B1)
-#define SUPA2 X(0x00B2)
-#define ROMAN1 X(0x2160)
-#define ROMAN2 X(0x2161)
-#define ROMAN3 X(0x2162)
-#define ROMAN4 X(0x2163)
-#define ROMAN5 X(0x2164)
-#define ROMAN6 X(0x2165)
-#define ROMAN7 X(0x2166)
-#define roman1 X(0x2170)
-#define roman2 X(0x2171)
-#define roman3 X(0x2172)
-#define roman4 X(0x2173)
-#define roman5 X(0x2174)
-#define roman6 X(0x2175)
-#define roman7 X(0x2176)
+#define IBANG UM(0x203D)
+#define RAROW UM(0x2192)
+#define LAROW UM(0x2190)
+#define DEGREE UM(0x00B0)
+#define OMEGA UM(0x03A9)
+#define WOMEGA UM(0x03C9)
+#define MICRO UM(0x00B5)
+#define PLUMIN UM(0x00B1)
+#define SUPA2 UM(0x00B2)
+#define ROMAN1 UM(0x2160)
+#define ROMAN2 UM(0x2161)
+#define ROMAN3 UM(0x2162)
+#define ROMAN4 UM(0x2163)
+#define ROMAN5 UM(0x2164)
+#define ROMAN6 UM(0x2165)
+#define ROMAN7 UM(0x2166)
+#define roman1 UM(0x2170)
+#define roman2 UM(0x2171)
+#define roman3 UM(0x2172)
+#define roman4 UM(0x2173)
+#define roman5 UM(0x2174)
+#define roman6 UM(0x2175)
+#define roman7 UM(0x2176)
-#ifdef UNICODEMAP_ENABLE // For Unicode characters larger than 0x8000. Send with X(<unicode>)
+#ifdef UNICODEMAP_ENABLE
enum Ext_Unicode{
PENGUIN = 0,
BOAR,
@@ -182,12 +182,12 @@ const uint32_t unicode_map[] PROGMEM = {
[CHICK] = 0x1F425,
[TUMBLER] = 0x1F943
};
-#define PENGY X(PENGUIN)
-#define BOARY X(BOAR)
-#define MNKY X(MONKEY)
-#define DRGN X(DRAGON)
-#define DUCK X(CHICK)
-#define TMBL X(TUMBLER)
+#define PENGY UM(PENGUIN)
+#define BOARY UM(BOAR)
+#define MNKY UM(MONKEY)
+#define DRGN UM(DRAGON)
+#define DUCK UM(CHICK)
+#define TMBL UM(TUMBLER)
#endif
//#endif