#include #include "functions.h" inline int sabs(int x){return(x<0)?-x:x;} int getEvt() { int evt = 0; if(isKeyPressed(KEY_NSPIRE_ESC)) evt |= 0x1; if(isKeyPressed(KEY_NSPIRE_ENTER)) evt |= 0x2; if(isKeyPressed(KEY_NSPIRE_UP)) evt |= 0x4; if(isKeyPressed(KEY_NSPIRE_DOWN)) evt |= 0x8; if(isKeyPressed(KEY_NSPIRE_RIGHT)) evt |= 0x10; if(isKeyPressed(KEY_NSPIRE_LEFT)) evt |= 0x20; if(isKeyPressed(KEY_NSPIRE_UPRIGHT)) evt |= 0x14; if(isKeyPressed(KEY_NSPIRE_RIGHTDOWN)) evt |= 0x18; if(isKeyPressed(KEY_NSPIRE_LEFTUP)) evt |= 0x24; if(isKeyPressed(KEY_NSPIRE_DOWNLEFT)) evt |= 0x28; if(isKeyPressed(KEY_NSPIRE_PLUS)) evt |= 0x40; if(isKeyPressed(KEY_NSPIRE_MINUS)) evt |= 0x80; if(isKeyPressed(KEY_NSPIRE_MULTIPLY)) evt |= 0x100; if(isKeyPressed(KEY_NSPIRE_DIVIDE)) evt |= 0x200; if(isKeyPressed(KEY_NSPIRE_X)) evt |= 0x400; if(isKeyPressed(KEY_NSPIRE_Y)) evt |= 0x800; if(isKeyPressed(KEY_NSPIRE_Z)) evt |= 0x1000; if(isKeyPressed(KEY_NSPIRE_J)) evt |= 0x2000; if(isKeyPressed(KEY_NSPIRE_M)) evt |= 0x4000; if(isKeyPressed(KEY_NSPIRE_DEL)) evt |= 0x8000; //if(evt) printf("%x\n", evt); return evt; }