You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the mapping of SFML keys to axis, currently hard-coded here, could be configurable - probably via a YAML file. You could implement this in the constructor of JoystickKeyboard something like this:
// Read config values from file
{
cv::FileStorage configFile(configFilename, cv::FileStorage::READ);
if(configFile.isOpened()) {
auto &configNode = configFile["config"];
cv::read(configNode["leftStickVertical"], m_AxisKeys[HID::JAxis::LeftStickVertical], m_AxisKeys[HID::JAxis::LeftStickVertical]);
// **TODO** other buttons and axes, ideally saving typing with loops!
}
}
// Re-write config file
{
cv::FileStorage configFile(configFilename, cv::FileStorage::WRITE)
configFile << "config" << "{";
configFile << "leftStickVertical" << m_AxisKeys[HID::JAxis::LeftStickVertical];
// **TODO** other buttons and axes, ideally saving typing with loops!
configFile << "}";
}
The text was updated successfully, but these errors were encountered:
neworderofjamie
changed the title
Make BoBRobotics::HID::JoystickGLFWKeyboard more configurable
Make BoBRobotics::Viz::JoystickKeyboard more configurable
Apr 28, 2021
It would be nice if the mapping of SFML keys to axis, currently hard-coded here, could be configurable - probably via a YAML file. You could implement this in the constructor of
JoystickKeyboard
something like this:The text was updated successfully, but these errors were encountered: