• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ clear_keyboard函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中clear_keyboard函数的典型用法代码示例。如果您正苦于以下问题:C++ clear_keyboard函数的具体用法?C++ clear_keyboard怎么用?C++ clear_keyboard使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了clear_keyboard函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
  switch(id) {
    case 0:
    if (record->event.pressed) {
      register_code(KC_RSFT);
      register_code(KC_RCTL);
      register_code(KC_ESC);
    }
    else{
      clear_keyboard();
    }
    break;
    case 1:
    if (record->event.pressed) {
      register_code(KC_LCTL);
      register_code(KC_LALT);
      register_code(KC_DEL);
    }
    else{
      clear_keyboard();
    }
    break;
  }
  return MACRO_NONE;
};
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:27,代码来源:keymap.c


示例2: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
	if (record->event.pressed) {
		switch(keycode) {
			case MAC_UE:
        if(keyboard_report->mods & MOD_BIT(KC_LSFT)) {
          clear_keyboard();
          SEND_STRING(SS_LALT("u") SS_LSFT("u"));
        } else {
				  SEND_STRING(SS_LALT("u")"u");
        }
				return false;
      case MAC_AE:
        if(keyboard_report->mods & MOD_BIT(KC_LSFT)) {
          clear_keyboard();
				  SEND_STRING(SS_LALT("u") SS_LSFT("a"));
        } else {
          SEND_STRING(SS_LALT("u")"a");
        }
        return false;
      case MAC_OE:
        if(keyboard_report->mods & MOD_BIT(KC_LSFT)) {
          clear_keyboard();
          SEND_STRING(SS_LALT("u") SS_LSFT("o"));
        } else {
          SEND_STRING(SS_LALT("u")"o");
        }
        return false;
      case MAC_SS:
        SEND_STRING(SS_LALT("s"));
        return false;
		}
	}
	return true;
};
开发者ID:20lives,项目名称:qmk_firmware,代码行数:34,代码来源:keymap.c


示例3: left_scan

void left_scan(void)
{
    uint8_t ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT);

    if (ret == 0)
    {
        i2c_stop();

        if (!i2c_initialized)
        {
            i2c_initialized = true;
            left_config();
            clear_keyboard();
            print("mcp23017 attached!!!\n");
        }
    }
    else
    {
        if (i2c_initialized)
        {
            i2c_initialized = false;
            clear_keyboard();
            print("mcp23017 deattached!!!\n");
        }
    }

    return;
}
开发者ID:UnderSampled,项目名称:qmk_firmware,代码行数:28,代码来源:left.c


示例4: command_common

static bool command_common(uint8_t code)
{
    static host_driver_t *host_driver = 0;
    switch (code) {
#ifdef SLEEP_LED_ENABLE
        case KC_Z:
            // test breathing sleep LED
            print("Sleep LED test\n");
            sleep_led_toggle();
            led_set(host_keyboard_leds());
            break;
#endif
#ifdef BOOTMAGIC_ENABLE
        case KC_E:
            print("eeconfig:\n");
            print_eeconfig();
            break;
#endif
#ifdef KEYBOARD_LOCK_ENABLE
        case KC_CAPSLOCK:
            if (host_get_driver()) {
                host_driver = host_get_driver();
                clear_keyboard();
                host_set_driver(0);
                print("Locked.\n");
            } else {
                host_set_driver(host_driver);
                print("Unlocked.\n");
            }
            break;
#endif
        case KC_H:
        case KC_SLASH: /* ? */
            command_common_help();
            break;
        case KC_C:
            debug_matrix   = false;
            debug_keyboard = false;
            debug_mouse    = false;
            debug_enable   = false;
            command_console_help();
            print("C> ");
            command_state = CONSOLE;
            break;
        case KC_PAUSE:
            clear_keyboard();
            print("\n\nbootloader... ");
            _delay_ms(1000);
            bootloader_jump(); // not return
            break;
        case KC_D:
            if (debug_enable) {
<<<<<<< HEAD
                print("\ndebug: off\n");
=======
                print("\ndebug: on\n");
>>>>>>> upstream/master
开发者ID:GorillaDiapers,项目名称:tmk_keyboard,代码行数:57,代码来源:command.c


示例5: action_tapping_process

void action_tapping_process(keyrecord_t record)
{
    if (process_tapping(&record)) {
        if (!IS_NOEVENT(record.event)) {
            debug("processed: "); debug_record(record); debug("\n");
        }
    } else {
        if (!waiting_buffer_enq(record)) {
            // clear all in case of overflow.
            debug("OVERFLOW: CLEAR ALL STATES\n");
            clear_keyboard();
            waiting_buffer_clear();
            tapping_key = (keyrecord_t){};
        }
    }

    // process waiting_buffer
    if (!IS_NOEVENT(record.event) && waiting_buffer_head != waiting_buffer_tail) {
        debug("---- action_exec: process waiting_buffer -----\n");
    }
    for (; waiting_buffer_tail != waiting_buffer_head; waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE) {
        if (process_tapping(&waiting_buffer[waiting_buffer_tail])) {
            debug("processed: waiting_buffer["); debug_dec(waiting_buffer_tail); debug("] = ");
            debug_record(waiting_buffer[waiting_buffer_tail]); debug("\n\n");
        } else {
            break;
        }
    }
    if (!IS_NOEVENT(record.event)) {
        debug("\n");
    }
}
开发者ID:dotdash32,项目名称:tmk_keyboard,代码行数:32,代码来源:action_tapping.c


示例6: keycode_to_action

/* translates keycode to action */
static action_t keycode_to_action(uint8_t keycode)
{
    action_t action = {};
    switch (keycode) {
        case KC_A ... KC_EXSEL:
        case KC_LCTRL ... KC_RGUI:
            action.code = ACTION_KEY(keycode);
            break;
        case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE:
            action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode));
            break;
        case KC_AUDIO_MUTE ... KC_WWW_FAVORITES:
            action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode));
            break;
        case KC_MS_UP ... KC_MS_ACCEL2:
            action.code = ACTION_MOUSEKEY(keycode);
            break;
        case KC_TRNS:
            action.code = ACTION_TRANSPARENT;
            break;
        case KC_BOOTLOADER:
            clear_keyboard();
            wait_ms(50);
            bootloader_jump(); // not return
            break;
        default:
            action.code = ACTION_NO;
            break;
    }
    return action;
}
开发者ID:kevinmost,项目名称:tmk_keyboard,代码行数:32,代码来源:keymap.c


示例7: exit_command_mode_2

static void exit_command_mode_2(void)
{
    print("Exiting config mode ...\n");
    SEND_COMMAND("---\r\n");    // exit
    clear_keyboard();
    host_set_driver(prev_driver);
}
开发者ID:lkong,项目名称:tmk_keyboard,代码行数:7,代码来源:rn42_task.c


示例8: reset_keyboard

void reset_keyboard(void) {
  clear_keyboard();
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
  process_midi_all_notes_off();
#endif
#ifdef AUDIO_ENABLE
  #ifndef NO_MUSIC_MODE
    music_all_notes_off();
  #endif
  uint16_t timer_start = timer_read();
  PLAY_SONG(goodbye_song);
  shutdown_user();
  while(timer_elapsed(timer_start) < 250)
    wait_ms(1);
  stop_all_notes();
#else
  shutdown_user();
  wait_ms(250);
#endif
// this is also done later in bootloader.c - not sure if it's neccesary here
#ifdef BOOTLOADER_CATERINA
  *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
#endif
  bootloader_jump();
}
开发者ID:kipricker,项目名称:qmk_firmware,代码行数:25,代码来源:quantum.c


示例9: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
  if (record->event.pressed) {
    switch(id) {
  case 0:
    return MACRO( D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), T(LEFT), END );
  case 1:
    return MACRO( D(LSFT), T(LBRC), U(LSFT), D(LSFT), T(RBRC), U(LSFT), T(LEFT), END );
  case 2:
    return MACRO( T(LBRC), T(RBRC), T(LEFT), END);
  case 3:
    clear_keyboard();
  case 4:
    return MACRO( D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(LBRACKET), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(BSLASH), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(7), U(LSFT), D(LSFT), T(RBRACKET), U(LSFT), T(SCOLON), D(LSFT), T(SCOLON), U(LSFT), END );
  case WINSH:
    set_unicode_input_mode(UC_WIN);
    return false;
    break;
  case WIN:
    set_unicode_input_mode(UC_WINC);
    return false;
    break;
  case OSX:
    set_unicode_input_mode(UC_OSX);
    return false;
    break;
   }
  }
 return MACRO_NONE;
};
开发者ID:20lives,项目名称:qmk_firmware,代码行数:29,代码来源:keymap.c


示例10: action_function

/*
 * user defined action function
 */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    uint8_t tap_count = record->tap.count;
    switch (id) {
        case RESET_LAYER_STATE:
            if (record->event.pressed) {
                if (!get_oneshot_locked_mods() && !get_oneshot_layer_state()) {
                    register_code(KC_ESC);
                }
            } else {
                if (!get_oneshot_locked_mods() && !get_oneshot_layer_state()) {
                    unregister_code(KC_ESC);
                } else {
                    reset_oneshot_layer();
                    clear_oneshot_locked_mods();
                    layer_clear();
                    clear_keyboard();
                }
            }
            break;
        case PROMICRO_RESET:
            if(tap_count == 5) {
                promicro_bootloader_jmp(false);
            }
            break;
        case PROMICRO_PROGRAM:
            if(tap_count == 5) {
                promicro_bootloader_jmp(true);
            }
            break;
        default:
            break;
    }
}
开发者ID:dotdash32,项目名称:tmk_keyboard,代码行数:37,代码来源:actionmap_plain.c


示例11: hook_usb_suspend_entry

void hook_usb_suspend_entry(void)
{
	//dprintf("huse\n");

    // Turn LED off to save power
    // Set 0 with putting aside status before suspend and restore
    // it after wakeup, then LED is updated at keyboard_task() in main loop
    _led_stats = keyboard_led_stats;
    keyboard_led_stats = 0;
    led_set(keyboard_led_stats);

    matrix_clear();
    clear_keyboard();

    send_sleep_to_other_side(true);
    mcpu_hardware_shutdown(true);

#ifdef BACKLIGHT_ENABLE
    suspend_animation();
    backlight_enableShutdown(true);
#endif

#ifdef SLEEP_LED_ENABLE
    sleep_led_enable();
#endif
}
开发者ID:alphaclon,项目名称:tmk_keyboard,代码行数:26,代码来源:hooks.c


示例12: hook_usb_wakeup

void hook_usb_wakeup(void)
{
	//dprintf("huwu\n");

	//
    // ---> This replaces the call of suspend_wakeup_init() <--
	//
    // suspend_wakeup_init();

    // clear keyboard state
    matrix_clear();
    clear_keyboard();
#ifdef BACKLIGHT_ENABLE
    //
    // --> do not call this! I2C IRQ will destroy USB communication! <--
    //
    // backlight_init();
    backlight_enableShutdown(false);
    resume_animation_in_idle_state();
#endif

#ifdef SLEEP_LED_ENABLE
    sleep_led_disable();
#endif

    mcpu_hardware_shutdown(false);
    send_sleep_to_other_side(false);

    // Restore LED status
    // BIOS/grub won't recognize/enumerate if led_set() takes long(around 40ms?)
    // Converters fall into the case and miss wakeup event(timeout to reply?) in the end.
    // led_set(host_keyboard_leds());
    // Instead, restore stats and update at keyboard_task() in main loop
    keyboard_led_stats = _led_stats;
}
开发者ID:alphaclon,项目名称:tmk_keyboard,代码行数:35,代码来源:hooks.c


示例13: switch_default_layer

static void switch_default_layer(uint8_t layer)
{
    print("switch_default_layer: "); print_dec(biton32(default_layer_state));
    print(" to "); print_dec(layer); print("\n");
    default_layer_set(1UL<<layer);
    clear_keyboard();
}
开发者ID:Wraul,项目名称:tmk_keyboard,代码行数:7,代码来源:command.c


示例14: suspend_wakeup_init

// run immediately after wakeup
void suspend_wakeup_init(void)
{
    // clear keyboard state
    clear_keyboard();
#ifdef BACKLIGHT_ENABLE
    backlight_init();
#endif
}
开发者ID:0mark,项目名称:tmk_keyboard,代码行数:9,代码来源:suspend.c


示例15: tmux

void tmux(bool pressed) {
    if (pressed) {
        add_mods(MOD_BIT(KC_LALT));
        add_key(KC_COMMA);
        send_keyboard_report();
        clear_keyboard();
    }
}
开发者ID:phatina,项目名称:ml67,代码行数:8,代码来源:keymap_phatina_functions.c


示例16: action_function

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    if (record->event.pressed) {
        switch (id) {
            case SWITCH_TO_BLE_DRIVER:
                clear_keyboard();
                _delay_ms(1000);
                host_set_driver(&nrf51822_driver);
                break;
            case SWITCH_TO_USB_DRIVER:
                clear_keyboard();
                _delay_ms(1000);
                host_set_driver(&lufa_driver);
                break;
        }
    }
}
开发者ID:doopai,项目名称:gh60,代码行数:17,代码来源:keymap_common.c


示例17: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  uint8_t mods = get_mods();
  clear_keyboard();

  handle_french_keycode(mods, keycode, record);

  set_mods(mods);

  return true;
}
开发者ID:oliger,项目名称:dotfiles,代码行数:10,代码来源:keymap.c


示例18: action_function

void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
{
    if (id == TEENSY_KEY) {
        clear_keyboard();
        print("\n\nJump to bootloader... ");
        _delay_ms(250);
        bootloader_jump(); // should not return
        print("not supported.\n");
    }
}
开发者ID:atykhonov,项目名称:tmk_keyboard,代码行数:10,代码来源:keymap.c


示例19: suspend_wakeup_init

// run immediately after wakeup
void suspend_wakeup_init(void)
{
    // clear keyboard state
    clear_keyboard();
#ifdef SUSPEND_ACTION
    suspend_wakeup_init_action();
#endif
#ifdef BACKLIGHT_ENABLE
    backlight_init();
#endif
}
开发者ID:xMaevy,项目名称:tmk_core_custom,代码行数:12,代码来源:suspend.c


示例20: reset_keyboard

void reset_keyboard(void) {
  clear_keyboard();
#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_ENABLE_BASIC))
  music_all_notes_off();
  shutdown_user();
#endif
  wait_ms(250);
#ifdef CATERINA_BOOTLOADER
  *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
#endif
  bootloader_jump();
}
开发者ID:2k0ri,项目名称:qmk_firmware,代码行数:12,代码来源:quantum.c



注:本文中的clear_keyboard函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ clear_keybuf函数代码示例发布时间:2022-05-30
下一篇:
C++ clear_interrupts函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap