X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=dfbapi.c;h=aeb6cffe723350fd088ff01d85c1f606209d043b;hp=4144783ece09132c3be5a3658125fe3868d93bbf;hb=e28fcecc54036e7258172b96e97df4a8131f0d9a;hpb=c171ab6d836d840b6463579cebe1ec01cb9f06f8 diff --git a/dfbapi.c b/dfbapi.c index 4144783..aeb6cff 100644 --- a/dfbapi.c +++ b/dfbapi.c @@ -6,6 +6,7 @@ */ #include +#include #include "dfbapi.h" /* two dimensional lattice */ @@ -282,10 +283,10 @@ int 2d_event_init(2d_lattice *2d_l) return 1; } -int 3d_event_init(3d_lattice *3d_l) +int d3_event_init(d3_lattice *d3_l) { - 3d_l->dfb->GetInputDevice(3d_l->dfb,DIDID_KEYBOARD,&(3d_l->keyboard)); - 3d_l->keyboard->CreateEventBuffer(3d_l->keyboard,&(3d_l->k_buffer)); + d3_l->dfb->GetInputDevice(d3_l->dfb,DIDID_KEYBOARD,&(3d_l->keyboard)); + d3_l->keyboard->CreateEventBuffer(d3_l->keyboard,&(d3_l->k_buffer)); return 1; } @@ -301,6 +302,10 @@ int scan_event(d3_lattice *d3_l,int *x,int *y,int *z,int *q,int *esc) if(ke.key_id==DIKI_RIGHT && *x!=d3_l->max_x-1) *x+=1; if(ke.key_id==DIET_DOWN && *y!=0) *y-=1; if(ke.key_id==DIET_UP && *y!=d3_l->max_y-1) *y+=1; + if(ke.key_id==DIET_PAGE_DOWN && *z!=0) *z-=1; + if(ke.key_id==DIET_PAGE_UP && *z!=d3_l->mac_z-1) *z+=1; + if(ke.key_id==DIKI_Q) *quit=1; + if(ke.key_id==DIKI_ESCAPE) *esc=1; } return 1;