0 Members and 3 Guests are viewing this topic.
typedef int KeyEvent; // because cleanlinessinline KeyEvent getk(void){ return (((isKeyPressed(KEY_NSPIRE_UP) << 1) + isKeyPressed(KEY_NSPIRE_RIGHT) << 1) + isKeyPressed(KEY_NSPIRE_LEFT) << 1) + isKeyPressed(KEY_NSPIRE_DOWN);}
typedef int KeyEvent;KeyEvent getk(void){ int i; KeyEvent k; while(!isKeyPressed(KEY_NSPIRE_ENTER)) { k = (((isKeyPressed(KEY_NSPIRE_UP) << 1) + isKeyPressed(KEY_NSPIRE_RIGHT) << 1) + isKeyPressed(KEY_NSPIRE_LEFT) << 1) + isKeyPressed(KEY_NSPIRE_DOWN); for(i = 3; i >= 0; i--) printf("%d", (k >> i) & 1); printf("\n"); SDL_Delay(1000); } return k;}