Reenabled rumble-test, but there is currently a huge delay, to do controller messages getting queed up
This commit is contained in:
parent
e00bc4584f
commit
0804ad2165
2 changed files with 13 additions and 2 deletions
|
@ -22,13 +22,14 @@
|
|||
#include "uinput.hpp"
|
||||
|
||||
UInputMessageProcessor::UInputMessageProcessor(UInput& uinput,
|
||||
ControllerSlotConfigPtr config,
|
||||
const Options& opts) :
|
||||
ControllerSlotConfigPtr config,
|
||||
const Options& opts) :
|
||||
m_uinput(uinput),
|
||||
m_config(config),
|
||||
m_oldmsg(),
|
||||
m_config_toggle_button(opts.config_toggle_button),
|
||||
m_rumble_gain(opts.rumble_gain),
|
||||
m_rumble_test(opts.rumble),
|
||||
m_rumble_callback()
|
||||
{
|
||||
memset(&m_oldmsg, 0, sizeof(m_oldmsg));
|
||||
|
@ -45,6 +46,14 @@ UInputMessageProcessor::send(const XboxGenericMsg& msg_in, int msec_delta)
|
|||
{
|
||||
XboxGenericMsg msg = msg_in;
|
||||
|
||||
if (m_rumble_test)
|
||||
{
|
||||
log_debug("rumble: " << get_axis(msg, XBOX_AXIS_LT) << " " << get_axis(msg, XBOX_AXIS_RT));
|
||||
|
||||
set_rumble(get_axis(msg, XBOX_AXIS_LT),
|
||||
get_axis(msg, XBOX_AXIS_RT));
|
||||
}
|
||||
|
||||
// handling switching of configurations
|
||||
if (m_config_toggle_button != XBOX_BTN_UNKNOWN)
|
||||
{
|
||||
|
@ -108,6 +117,7 @@ UInputMessageProcessor::set_config(int num)
|
|||
void
|
||||
UInputMessageProcessor::set_ff_callback(const boost::function<void (uint8_t, uint8_t)>& callback)
|
||||
{
|
||||
m_rumble_callback = callback;
|
||||
m_config->set_ff_callback(callback);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ private:
|
|||
XboxButton m_config_toggle_button;
|
||||
|
||||
int m_rumble_gain;
|
||||
bool m_rumble_test;
|
||||
boost::function<void (uint8_t, uint8_t)> m_rumble_callback;
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Reference in a new issue