Class: Rjoystick::Event

Inherits:
Object
  • Object
show all
Defined in:
ext/rjoystick.c

Constant Summary collapse

JSBUTTON =
INT2FIX(JS_EVENT_BUTTON)
JSAXIS =
INT2FIX(JS_EVENT_AXIS)
JSINIT =
INT2FIX(JS_EVENT_INIT)

Instance Method Summary collapse

Instance Method Details

#numberObject



194
195
196
197
198
199
# File 'ext/rjoystick.c', line 194

VALUE js_event_number(VALUE klass)
{
	int *fd;
	Data_Get_Struct(klass, int, fd);
	return INT2FIX((fd && *fd >= 0) ? jse[*fd].number : -1);
}

#timeObject



208
209
210
211
212
213
# File 'ext/rjoystick.c', line 208

VALUE js_event_time(VALUE klass)
{
	int *fd;
	Data_Get_Struct(klass, int, fd);
	return INT2FIX((fd && *fd >= 0) ? jse[*fd].time : 0);
}

#typeObject



201
202
203
204
205
206
# File 'ext/rjoystick.c', line 201

VALUE js_event_type(VALUE klass)
{
	int *fd;
	Data_Get_Struct(klass, int, fd);
	return INT2FIX((fd && *fd >= 0) ? jse[*fd].type : -1);
}

#valueObject



215
216
217
218
219
220
# File 'ext/rjoystick.c', line 215

VALUE js_event_value(VALUE klass)
{
	int *fd;
	Data_Get_Struct(klass, int, fd);
	return INT2FIX((fd && *fd >= 0) ? jse[*fd].value : -1);
}