Moved xboxdrv stuff into subdirectory as well

This commit is contained in:
Ingo Ruhnke 2008-12-27 05:20:47 +01:00
parent 483f4e6c80
commit 4c9124e56b
24 changed files with 27 additions and 19 deletions

View file

@ -1,17 +1,17 @@
# -*- python -*-
env = Environment(CPPFLAGS=["-g", "-O2", "-Wall"], LIBS=["usb"])
env.Program("xboxdrv", ["xboxdrv.cpp",
"xboxmsg.cpp",
"uinput.cpp",
"helper.cpp",
"command_line_options.cpp",
"xbox_controller.cpp",
"xbox360_controller.cpp",
"xbox360_wireless_controller.cpp",
env.Program("xboxdrv", ["src/xboxdrv.cpp",
"src/xboxmsg.cpp",
"src/uinput.cpp",
"src/helper.cpp",
"src/command_line_options.cpp",
"src/xbox_controller.cpp",
"src/xbox360_controller.cpp",
"src/xbox360_wireless_controller.cpp",
])
if False:
if True:
env.Program("inputdrv",
["src/inputdrv/inputdrv.cpp",
"src/inputdrv/xbox360_driver.cpp",

View file

@ -135,7 +135,8 @@ UInputDriver::on_rel(RelPortOut* port, uint16_t code)
ev.code = code;
ev.value = port->get_state();
write(fd, &ev, sizeof(ev));
if (write(fd, &ev, sizeof(ev)) < 0)
throw std::runtime_error(strerror(errno));
// Mouse Dev need these to send out events
memset(&ev, 0, sizeof(ev));
@ -144,7 +145,8 @@ UInputDriver::on_rel(RelPortOut* port, uint16_t code)
ev.type = EV_SYN;
ev.code = SYN_REPORT;
write(fd, &ev, sizeof(ev));
if (write(fd, &ev, sizeof(ev)) < 0)
throw std::runtime_error(strerror(errno));
}
}
@ -159,7 +161,8 @@ UInputDriver::on_abs(AbsPortOut* port, uint16_t code)
ev.code = code;
ev.value = port->get_state();
write(fd, &ev, sizeof(ev));
if (write(fd, &ev, sizeof(ev)) < 0)
throw std::runtime_error(strerror(errno));
}
void
@ -173,7 +176,8 @@ UInputDriver::on_btn(BtnPortOut* port, uint16_t code)
ev.code = code;
ev.value = port->get_state();
write(fd, &ev, sizeof(ev));
if (write(fd, &ev, sizeof(ev)) < 0)
throw std::runtime_error(strerror(errno));
// Mouse Dev need these to send out events
memset(&ev, 0, sizeof(ev));
@ -182,14 +186,18 @@ UInputDriver::on_btn(BtnPortOut* port, uint16_t code)
ev.type = EV_SYN;
ev.code = SYN_REPORT;
write(fd, &ev, sizeof(ev));
if (write(fd, &ev, sizeof(ev)) < 0)
throw std::runtime_error(strerror(errno));
}
void
UInputDriver::finish()
{
std::cout << "Finalizing UInput" << std::endl;
write(fd, &user_dev, sizeof(user_dev));
if (write(fd, &user_dev, sizeof(user_dev)) < 0)
throw std::runtime_error(strerror(errno));
if (ioctl(fd, UI_DEV_CREATE))
{
std::cout << "Unable to create UINPUT device." << std::endl;

View file

@ -22,7 +22,7 @@
#include <iostream>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include "../../xboxmsg.hpp"
#include "../xboxmsg.hpp"
#include "log.hpp"
#include "xbox360_usb_thread.hpp"
#include "xbox360_driver.hpp"

View file

@ -20,7 +20,7 @@
#define HEADER_XBOX360_DRIVER_HPP
#include <vector>
#include "../../xboxdrv.hpp"
#include "../xboxdrv.hpp"
#include "control.hpp"
class Xbox360UsbThread;

View file

@ -22,7 +22,7 @@
#include <stdexcept>
#include <boost/format.hpp>
#include "log.hpp"
#include "../../xboxmsg.hpp"
#include "../xboxmsg.hpp"
#include "xbox360_usb_thread.hpp"
Xbox360UsbThread::Xbox360UsbThread(struct usb_device* dev)

View file

@ -22,7 +22,7 @@
#include <inttypes.h>
#include <pthread.h>
#include <queue>
#include "../../xboxdrv.hpp"
#include "../xboxdrv.hpp"
/** A worker thread that reads from the USB device in a blocking
fashion, so that the Xbox360Driver can stay non blocking.