本文整理汇总了C++中rgblight_mode函数的典型用法代码示例。如果您正苦于以下问题:C++ rgblight_mode函数的具体用法?C++ rgblight_mode怎么用?C++ rgblight_mode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rgblight_mode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: layer_state_set_user
uint32_t layer_state_set_user(uint32_t state) {
if (state == 0 && edit == true) {
mode = rgblight_get_mode();
hue = rgblight_get_hue();
sat = rgblight_get_sat();
val = rgblight_get_val();
edit = false;
}
switch (biton32(state)) {
case 1:
rgblight_mode(1);
rgblight_setrgb(0xD3, 0x7F, 0xED);
break;
case 2:
rgblight_mode(1);
rgblight_setrgb(0xFF, 0x00, 0x00);
edit = true;
break;
default:
rgblight_mode(mode);
rgblight_sethsv(hue, sat, val);
break;
}
return state;
}
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:27,代码来源:keymap.c
示例2: matrix_scan_user
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
case _NAV:
if (RGB_INIT) {} else {
RGB_current_mode = rgblight_config.mode;
RGB_INIT = true;
}
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
rgblight_mode(29);
}
break;
case _LOWER:
if (RGB_INIT) {} else {
RGB_current_mode = rgblight_config.mode;
RGB_INIT = true;
}
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
rgblight_mode(29);
}
break;
case _QWERTY:
if (RGB_INIT) {} else {
RGB_current_mode = rgblight_config.mode;
RGB_INIT = true;
}
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
TOG_STATUS = false;
break;
}
};
开发者ID:20lives,项目名称:qmk_firmware,代码行数:35,代码来源:keymap.c
示例3: led_set_user
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
rgblight_mode(18);
} else {
rgblight_mode(14);
}
}
开发者ID:am,项目名称:qmk_firmware,代码行数:7,代码来源:keymap.c
示例4: led_set_user
void led_set_user( uint8_t usb_led )
{
static uint8_t old_usb_led = 0;
wait_ms( 10 ); /* gets rid of tick */
if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) {
/* CAPS on */
caps= true;
rgblight_setrgb( 0,0,0 );
rgblight_setrgb_at(RGB_Caps_Color,12); // caps key
#ifdef AUDIO_ENABLE
PLAY_SONG( tone_caps );
#endif
}else if ( !(usb_led & (1 << USB_LED_CAPS_LOCK) ) && (old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) {
/* CAPS off */
caps= false;
if (RGB_TAP_STATE==false){
rgblight_mode( RGB_LAYER0_mode );
}else{
rgblight_mode(1);
rgblight_setrgb( 0,0,0 );
}
#ifdef AUDIO_ENABLE
PLAY_SONG( tone_caps );
#endif
}
old_usb_led = usb_led;
} // End of led_set_user
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:29,代码来源:keymap.c
示例5: matrix_init_keymap
void matrix_init_keymap(void) {
#if 0
#ifdef RGB_MATRIX_KEYPRESSES
rgblight_mode(RGB_MATRIX_MULTISPLASH);
#else
rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON);
#endif
#endif
}
开发者ID:UnderSampled,项目名称:qmk_firmware,代码行数:9,代码来源:keymap.c
示例6: rgblight_init
void rgblight_init(void) {
debug_enable = 1; // Debug ON!
dprintf("rgblight_init called.\n");
rgblight_inited = 1;
dprintf("rgblight_init start!\n");
if (!eeconfig_is_enabled()) {
dprintf("rgblight_init eeconfig is not enabled.\n");
eeconfig_init();
eeconfig_update_rgblight_default();
}
rgblight_config.raw = eeconfig_read_rgblight();
if (!rgblight_config.mode) {
dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n");
eeconfig_update_rgblight_default();
rgblight_config.raw = eeconfig_read_rgblight();
}
eeconfig_debug_rgblight(); // display current eeprom values
#ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_init(); // setup the timer
#endif
if (rgblight_config.enable) {
rgblight_mode(rgblight_config.mode);
}
}
开发者ID:chrischambers,项目名称:qmk_firmware,代码行数:26,代码来源:rgblight.c
示例7: rgblight_enable
void rgblight_enable(void) {
rgblight_config.enable = 1;
// No need to update EEPROM here. rgblight_mode() will do that, actually
//eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
rgblight_mode(rgblight_config.mode);
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:7,代码来源:rgblight.c
示例8: matrix_init_user
// Call user matrix init, set default RGB colors and then
// call the keymap's init function
void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
uint8_t default_layer = eeconfig_read_default_layer();
rgblight_enable();
if (true) {
if (default_layer & (1UL << _COLEMAK)) {
rgblight_set_magenta;
}
else if (default_layer & (1UL << _DVORAK)) {
rgblight_set_green;
}
else if (default_layer & (1UL << _WORKMAN)) {
rgblight_set_purple;
}
else {
rgblight_set_teal;
}
}
else
{
rgblight_set_red;
rgblight_mode(5);
}
#endif
#ifdef AUDIO_ENABLE
// wait_ms(21); // gets rid of tick
// stop_all_notes();
// PLAY_SONG(tone_hackstartup);
#endif
matrix_init_keymap();
}
开发者ID:jmatth,项目名称:qmk_firmware,代码行数:35,代码来源:drashna.c
示例9: rgblight_increase
void rgblight_increase(void) {
uint8_t mode = 0;
if (rgblight_config.mode < RGBLIGHT_MODES) {
mode = rgblight_config.mode + 1;
}
rgblight_mode(mode);
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:7,代码来源:rgblight.c
示例10: process_record_user
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// dynamically generate these.
case EPRM:
if (record->event.pressed) {
eeconfig_init();
}
return false;
break;
case VRSN:
if (record->event.pressed) {
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
return false;
break;
case RGB_SLD:
if (record->event.pressed) {
#ifdef RGBLIGHT_ENABLE
rgblight_mode(1);
#endif
}
return false;
break;
}
return true;
}
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:26,代码来源:keymap.c
示例11: process_record_user
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
#ifdef SSD1306OLED
set_keylog(keycode, record);
#endif
// set_timelog();
}
switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
case RGB_MOD:
#ifdef RGBLIGHT_ENABLE
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
rgblight_step();
RGB_current_mode = rgblight_config.mode;
}
#endif
return false;
break;
case RGBRST:
#ifdef RGBLIGHT_ENABLE
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
RGB_current_mode = rgblight_config.mode;
}
#endif
break;
}
return true;
}
开发者ID:Depariel,项目名称:qmk_firmware,代码行数:59,代码来源:keymap.c
示例12: matrix_scan_user
void matrix_scan_user(void) {
if (runonce && timer_elapsed(my_timer) > 1000) {
runonce = false;
rgblight_sethsv(0x0, 0xff, 0x80);
rgblight_mode(9);
rgblight_enable();
}
}
开发者ID:crokobit,项目名称:qmk_firmware,代码行数:8,代码来源:bigswitch.c
示例13: rgblight_decrease
void rgblight_decrease(void) {
uint8_t mode = 0;
// Mode will never be < 1. If it ever is, eeprom needs to be initialized.
if (rgblight_config.mode > 1) {
mode = rgblight_config.mode - 1;
}
rgblight_mode(mode);
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:8,代码来源:rgblight.c
示例14: process_record_user
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef RGBLIGHT_ENABLE
static uint32_t savedRgbMode;
static uint16_t savedHue;
static uint8_t savedSat;
static uint8_t savedVal;
if (keycode == KC_ESC) {
if (record->event.pressed) {
savedRgbMode = rgblight_get_mode();
savedHue = rgblight_get_hue();
savedSat = rgblight_get_sat();
savedVal = rgblight_get_val();
rgblight_mode(1);
rgblight_setrgb(255, 0, 0);
} else {
rgblight_mode(savedRgbMode);
rgblight_sethsv(savedHue, savedSat, savedVal);
}
}
#endif
// If console is enabled, it will print the matrix position and status of each key pressed
#ifdef CONSOLE_ENABLE
xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed);
#endif //CONSOLE_ENABLE
switch (keycode) {
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed) {
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
#if defined(BOOTLOADER_HALFKAY)
":teensy"
#elif defined(BOOTLOADER_CATERINA)
":avrdude"
#else
":dfu"
#endif
SS_TAP(X_ENTER));
}
return false;
break;
}
return process_record_keymap(keycode, record);
}
开发者ID:bellwood4486,项目名称:qmk_firmware,代码行数:46,代码来源:talljoe.c
示例15: startup_user
void startup_user()
{
#ifdef RGB_MATRIX_ENABLE
rgblight_mode(RGB_MATRIX_CYCLE_ALL);
#endif //RGB_matrix
wait_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:8,代码来源:keymap.c
示例16: update_tri_layer_RGB
void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
rgblight_mode(RGB_current_mode);
layer_on(layer3);
} else {
layer_off(layer3);
}
}
开发者ID:0tsuki,项目名称:qmk_firmware,代码行数:8,代码来源:keymap.c
示例17: rgblight_step_reverse
void rgblight_step_reverse(void) {
uint8_t mode = 0;
mode = rgblight_config.mode - 1;
if (mode < 1) {
mode = RGBLIGHT_MODES;
}
rgblight_mode(mode);
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:8,代码来源:rgblight.c
示例18: rgblight_step
void rgblight_step(void) {
uint8_t mode = 0;
mode = rgblight_config.mode + 1;
if (mode > RGBLIGHT_MODES) {
mode = 1;
}
rgblight_mode(mode);
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:8,代码来源:rgblight.c
示例19: matrix_scan_user
void matrix_scan_user(void) {
static int scan_count = 0;
if( scan_count == 2 ) {
rgblight_enable();
rgblight_mode(35);
}
if( scan_count < 3 ) scan_count ++;
iota_gfx_task(); // this is what updates the display continuously
}
开发者ID:yayaco885,项目名称:qmk_firmware,代码行数:9,代码来源:keymap.c
示例20: dance_flsh_finished
// on the fourth tap, set the keyboard on flash state
// and set the underglow to red, because red == bad
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
if (state->count >= 4) {
rgblight_enable();
rgblight_mode(1);
rgblight_setrgb(0xff,0x00,0x00);
reset_keyboard();
reset_tap_dance(state);
}
}
开发者ID:berfarah,项目名称:qmk_firmware,代码行数:11,代码来源:keymap.c
注:本文中的rgblight_mode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论