1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-28 12:27:40 +00:00

improved key handling: numpad works as directions with numlock off and numbers with numlock on; shift+5 works now; better key assignments in crystal rug

This commit is contained in:
Zeno Rogue
2018-12-06 12:31:51 +01:00
parent 9b21b9c5a0
commit b256ac70af
9 changed files with 115 additions and 93 deletions

View File

@@ -976,7 +976,7 @@ extern hyperpoint mouseh;
extern hyperpoint ccenter;
extern ld crad;
extern bool mousepressed, anyshiftclick;
extern bool mousepressed, anyshiftclick, numlock_on;
extern string help;
typedef function<void()> reaction_t;
@@ -2488,7 +2488,12 @@ extern function <bool(SDL_Event &ev)> joyhandler;
void gmodekeys(int sym, int uni);
// check for a plain number key
bool numberkey(int sym, int uni, char number);
#define NUMBERKEY (interpret_as_direction(sym, uni) ? 0 : uni)
#define DKEY (get_direction_key(sym, uni))
#define DIRECTIONKEY (interpret_as_direction(sym, uni) ? uni : 0)
bool interpret_as_direction(int sym, int uni);
int get_direction_key(int sym, int uni);
void switchGL();
void switchFullscreen();