summaryrefslogtreecommitdiff
path: root/jouer.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-07 13:06:57 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-07 13:06:57 +0100
commitf4dee994b5f9019d805328d1019b4456f6bb4b2d (patch)
tree08bf5258c69a539380cefb2fa697b770efaa43f3 /jouer.c
parente984a172127c3d13ac85c29511c68784ca43984c (diff)
game: added vim key bindings to UP/DOWN/LEFT/RIGHT
h/j/k/l are mapped to behave like arrow keys so that the navigation is easier in the menus. F and A are respectiverly used to validate and cancel as well. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'jouer.c')
-rw-r--r--jouer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/jouer.c b/jouer.c
index 066fce8..0b7641a 100644
--- a/jouer.c
+++ b/jouer.c
@@ -57,12 +57,14 @@ int Fjouer (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[],ENNEM
switch(event.key.keysym.unicode)
{
case SDLK_ESCAPE:
+ case SDLK_a:
continuer=0;
break;
}
switch (event.key.keysym.sym)
{
case SDLK_UP:
+ case SDLK_k:
if (selection!=0)
selection--;
else
@@ -71,6 +73,7 @@ int Fjouer (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[],ENNEM
Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,ACTIONS,NULL);
break;
case SDLK_DOWN:
+ case SDLK_j:
if (selection!=nbactions-1)
selection++;
else
@@ -79,6 +82,7 @@ int Fjouer (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[],ENNEM
Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,ACTIONS,NULL);
break;
case SDLK_RETURN:
+ case SDLK_f:
if(selection==ATTAQUE)
Fattaquer(surfaces,positions,persos,&Vtourallie,ennemis,Vnbennemis,&Vtour);
else if(selection==MAGIE_BLANCHE)