#include "keypad.h" int map[]={ KEY_X, // 0 KEY_ONE, // 1 KEY_TWO, // 2 KEY_THREE, // 3 KEY_Q, // 4 KEY_W, // 5 KEY_E, // 6 KEY_A, // 7 KEY_S, // 8 KEY_D, // 9 KEY_Z, // A KEY_C, // B KEY_FOUR, // C KEY_R, // D KEY_F, // E KEY_V // F }; int KeypadIsPressed(unsigned char c){ if(c<=0xF){ if(IsKeyPressed(map[c])) return 1; } return 0; } int KeypadGetPressed(){ int keycode=GetKeyPressed(); if(keycode){ for(int i=0;i<16;i++){ if(map[i]==keycode) return 1; } } return -1; }