3 #include "CJoyStickG27.h"
5 CJoyStickG27::CJoyStickG27() : CJoyStickEV() {
8 CJoyStickG27::~CJoyStickG27() {
11 int CJoyStickG27::Open() {
12 m_devName = std::string(D_DEV_NAME_G27);
13 int rfd = CJoyStickEV::Open();
18 if (0 > ioctl(rfd, EVIOCGABS(ABS_X), &m_absInf[E_ABSX])) {
19 std::cerr << "ioctl(EVIOCGABS(ABS_X)) get error" << std::endl;
20 m_absInf[E_ABSX].minimum = 0;
21 m_absInf[E_ABSX].maximum = 16384;
23 if (0 > ioctl(rfd, EVIOCGABS(ABS_Y), &m_absInf[E_ABSY])) {
24 std::cerr << "ioctl(EVIOCGABS(ABS_Y)) get error" << std::endl;
25 m_absInf[E_ABSY].minimum = 0;
26 m_absInf[E_ABSY].maximum = 255;
28 if (0 > ioctl(rfd, EVIOCGABS(ABS_Z), &m_absInf[E_ABSZ])) {
29 std::cerr << "ioctl(EVIOCGABS(ABS_Z)) get error" << std::endl;
30 m_absInf[E_ABSZ].minimum = 0;
31 m_absInf[E_ABSZ].maximum = 255;
33 if (0 > ioctl(rfd, EVIOCGABS(ABS_RZ), &m_absInf[E_ABSRZ])) {
34 std::cerr << "ioctl(EVIOCGABS(ABS_RZ)) get error" << std::endl;
35 m_absInf[E_ABSRZ].minimum = 0;
36 m_absInf[E_ABSRZ].maximum = 255;
38 if (0 > ioctl(rfd, EVIOCGABS(ABS_HAT0X), &m_absInf[E_ABSHAT0X])) {
39 std::cerr << "ioctl(EVIOCGABS(ABS_HAT0X)) get error" << std::endl;
40 m_absInf[E_ABSHAT0X].minimum = -1;
41 m_absInf[E_ABSHAT0X].maximum = 1;
43 if (0 > ioctl(rfd, EVIOCGABS(ABS_HAT0Y), &m_absInf[E_ABSHAT0Y])) {
44 std::cerr << "ioctl(EVIOCGABS(ABS_HAT0Y)) get error" << std::endl;
45 m_absInf[E_ABSHAT0Y].minimum = -1;
46 m_absInf[E_ABSHAT0Y].maximum = 1;