mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 08:23:50 -04:00
action: Revert my unsigned vs. signed "fix"
Totally misread the code in the Action_keys::act method -- the code actually reverse sends events in an up condition. Still, keeping the C++11 iteration and improving by using boost::adaptors::reverse.
This commit is contained in:
parent
b81ec75c82
commit
390995bf03
@ -1,5 +1,6 @@
|
||||
#include "action.h"
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
@ -35,9 +36,16 @@ Action_Keys::~Action_Keys() {
|
||||
}
|
||||
|
||||
void Action_Keys::act(Device &g13, bool is_down) {
|
||||
if (is_down) {
|
||||
for (auto key : _keys) {
|
||||
g13.send_event(EV_KEY, key, is_down);
|
||||
G13_LOG(trace, "sending KEY " << (is_down ? "DOWN " : "UP ") << key);
|
||||
G13_LOG(trace, "sending KEY DOWN " << key);
|
||||
}
|
||||
} else {
|
||||
for (auto key : boost::adaptors::reverse(_keys)) {
|
||||
g13.send_event(EV_KEY, key, is_down);
|
||||
G13_LOG(trace, "sending KEY UP " << key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user