Files
padkey_linux/pointer.c
2013-04-01 10:50:36 +09:00

30 lines
532 B
C

/*
* Released into the public domain
* by Aki Goto <tyatsumi@gmail.com>
*/
#include "pointer.h"
void Pointer_initialize(struct Pointer *this)
{
this->xNumber = 0;
this->yNumber = 1;
this->vx = 0;
this->vy = 0;
this->leftNumber = 5;
this->rightNumber = 4;
}
void Pointer_update(struct Pointer *this, struct js_event *event)
{
if (event->type != JS_EVENT_AXIS) {
return;
}
if (event->number == this->xNumber) {
this->vx = event->value;
} else if (event->number == this->yNumber) {
this->vy = event->value;
}
}