#include "rgblight.h"
#endif
+/*-------------*\
+|*---UNICODE---*|
+\*-------------*/
+#ifdef UNICODE_ENABLE
+#endif
+
/*-----------------*\
|*-----SECRETS-----*|
\*-----------------*/
/* ----------------------- *\
* -----RGB Functions----- *
\* ----------------------- */
-
-
#ifdef RGBLIGHT_ENABLE
// Storage variables
extern rgblight_config_t rgblight_config;
rgblight_mode(1);
rgblight_sethsv(hu,sa,va);
}
-/* HSV values, thank you @drashna!
+/* HSV values
* white ( 0, 0, 255)
* red ( 0, 255, 255)
* coral ( 16, 176, 255)
* magenta (300, 255, 255)
* pink (330, 128, 255)
*/
+
// Set RGBLIGHT state depending on layer
-void rgblight_change( uint8_t last_layer ) {
+void rgblight_change( uint8_t this_layer ) {
// Save state, if saving is requested
- /*
if ( base_sta ) {
rgblight_saveBase();
}
- */
// Change RGB light
- switch ( last_layer ) {
+ switch ( this_layer ) {
case _DV:
// Load base layer
rgblight_loadBase();
// Do green for mouse
rgblight_colorStatic(120,255,255);
break;
-#ifdef AUDIO_ENABLE
case _MU:
// Do orange for music
rgblight_colorStatic( 39,255,255);
break;
-#endif
default:
// Something went wrong
rgblight_colorStatic( 0,255,255);
matrix_init_keymap();
// Correct unicode
+#ifdef UNICODE_ENABLE
set_unicode_input_mode(UC_LNX);
+#endif
// Make beginning layer DVORAK
set_single_persistent_default_layer(_DV);
void matrix_scan_user (void) {
// Keymap specific, do it first
matrix_scan_keymap();
- // Moved RGB check to layer_state_set_user
}
/*------------------*\
switch (keycode) {
// Secrets implementation
- case SECRET1 ... SECRET3:
#if (__has_include("secrets.h"))
+ case SECRET1:
if( !record->event.pressed ) {
send_string_P( secret[ keycode - SECRET1 ] );
}
-#endif
return false;
break;
+ case SECRET2:
+ if( !record->event.pressed ) {
+ send_string_P( secret[ keycode - SECRET2 ] );
+ }
+ return false;
+ break;
+ case SECRET3:
+ if( !record->event.pressed ) {
+ send_string_P( secret[ keycode - SECRET3 ] );
+ }
+ return false;
+ break;
+#endif
+
// If these keys are pressed, load base layer config, and mark saving
+#ifdef RGBLIGHT_ENABLE
case RGB_TOG:
case RGB_MOD:
case RGB_VAI:
case RGB_SAD:
case RGB_HUI:
case RGB_HUD:
-#ifdef RGBLIGHT_ENABLE
if ( !base_sta ) {
rgblight_loadBase();
}
-#endif
return true;
break;
+#endif
// Lock functionality: These layers are locked if the LOCKED buttons are
// pressed. Otherwise, they are momentary toggles
return false;
break;
case K_MOUSE:
-#ifdef MOUSEKEY_ENABLE
if (record->event.pressed) {
layer_on(_MO);
lock_flag = false;
layer_off(_MO);
}
}
-#endif
return false;
break;
case K_NUMBR:
return false;
break;
case MU_TOG:
-#ifdef AUDIO_ENABLE
if (record->event.pressed) {
// On press, turn off layer if active
if ( layer == _SE ) {
layer_off(_MU);
}
}
-#endif
return true;
break;
//------UNICODE
// Unicode switches with sound
- case UNI_LI:
#ifdef UNICODE_ENABLE
+ case UNI_LI:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
#endif
set_unicode_input_mode(UC_LNX);
}
-#endif
return false;
break;
case UNI_WN:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
#endif
set_unicode_input_mode(UC_WIN);
}
-#endif
return false;
break;
// Turkish letters, with capital functionality
case TUR_A:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_O:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_U:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_I:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_G:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_C:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
case TUR_S:
-#ifdef UNICODE_ENABLE
if (record->event.pressed) {
if ( is_capital ) {
unicode_input_start();
unicode_input_finish();
}
}
-#endif
return false;
break;
+#endif
//-------Diagonal mouse movements
- case MO_NE:
#ifdef MOUSEKEY_ENABLE
+ case MO_NE:
if( record->event.pressed ) {
mousekey_on(MO_N);
mousekey_on(MO_E);
mousekey_off(MO_E);
mousekey_send();
}
-#endif
return false;
break;
case MO_NW:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_N);
mousekey_on(MO_W);
mousekey_off(MO_W);
mousekey_send();
}
-#endif
return false;
break;
case MO_SE:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S);
mousekey_on(MO_E);
mousekey_off(MO_E);
mousekey_send();
}
-#endif
return false;
break;
case MO_SW:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S);
mousekey_on(MO_W);
mousekey_off(MO_W);
mousekey_send();
}
-#endif
return false;
break;
case MO_S_NE:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S_N);
mousekey_on(MO_S_E);
mousekey_off(MO_S_E);
mousekey_send();
}
-#endif
return false;
break;
case MO_S_NW:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S_N);
mousekey_on(MO_S_W);
mousekey_off(MO_S_W);
mousekey_send();
}
-#endif
return false;
break;
case MO_S_SE:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S_S);
mousekey_on(MO_S_E);
mousekey_off(MO_S_E);
mousekey_send();
}
-#endif
return false;
break;
case MO_S_SW:
-#ifdef MOUSEKEY_ENABLE
if( record->event.pressed ) {
mousekey_on(MO_S_S);
mousekey_on(MO_S_W);
mousekey_off(MO_S_W);
mousekey_send();
}
-#endif
return false;
break;
+#endif
+
//------DOUBLE PRESS, with added left navigation
case DBL_SPC:
if( record->event.pressed ) {