📄 button.c
字号:
//#include <stdio.h>#include <button.h>#include <vstring.h>#include <param.h>static button_handler_t *button_handlers = NULL;voidadd_button_handler(button_handler_t *handler){ if (button_handlers == NULL) { button_handlers = handler; } else { handler->next = button_handlers; button_handlers = handler; }}voidcheck_buttons(void){ button_handler_t *handler = button_handlers; printk("Cheking buttons\n"); while (handler != NULL) { if (handler->func()) { /* If button is pressed */ if (handler->name != NULL) printk(" Detected %s button.\n", handler->name); add_linux_cmd_line(handler->cmdstr); } if (handler->next != NULL) handler = handler->next; else handler = NULL; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -