keyboard.h

来自「基于avr单片机的氢气测控系统源代码」· C头文件 代码 · 共 38 行

H
38
字号
///////////////////////////////////////////////////////////////////////////////
//      /src/keyboard.h
//I put keyboard related method declarations here and implement
//them in /src/keyboar.c
//
//Created by Chen Hongquan.
////////////////////////////////////////////////////////////////////////////////

#ifndef __KEYBOARD_H
#define __KEYBOARD_H
typedef struct key
{
    unsigned char keyPressMask;
    unsigned char keyReleaseMask;
    unsigned char preStatus;       //Previous status. 1: pressed. 0: released.
    unsigned char curStatus;       //Current status. 1: pressed. 0: released.
    void (*p_callFunction)(void);      //primary key function.
    void (*p_callDefault)(void);       //Default function, in order to extends 
                                       //our function. For example, we can add
				       //implement into the function to deal 
				       //with hold key action and put the
				       //function address here.
}key;

void initKeyboard(void);

void onKey1Pressed(void);
void onKey2Pressed(void);
void onKey3Pressed(void);
void onKey4Pressed(void);

void onKey1Default(void);
void onKey2Default(void);
void onKey3Default(void);
void onKey4Default(void);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?