Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

/* ------------------ */
/*  Keyboard handler  */
/* ------------------ */

#include "include/auto.h"
#include "include/const.h"


void keyb_handler() {
  KEY_EVT k;
  keyb_set_map(itaMap);

  /* Exit keys:  ESC */
  k.flag = 0;
  k.scan = KEY_ESC;
  k.ascii = 1;
  keyb_hook(k, endfun);


  /* moving the person ahead*/
  k.flag = 0;
  k.scan = KEY_A;
  k.ascii = 'a';
  keyb_hook(k,moveup);

  /* moving the person ahead*/
  k.flag = 0;
  k.scan = KEY_Z;
  k.ascii = 'z';
  keyb_hook(k,movedown);
}

void endfun(KEY_EVT *k)
{
  grx_close();
  cprintf("Ctrl-Brk pressed! Ending...\n");
  sys_end();
}