Support NoPress gesture mode on none direction
Fix #122, makes logid.example.cfg accurate.
This commit is contained in:
parent
4cfc2515d5
commit
3b4b90dac0
|
@ -227,6 +227,28 @@ GestureAction::Config::Config(Device* device, libconfig::Setting &root) :
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d == None) {
|
if(d == None) {
|
||||||
|
try {
|
||||||
|
auto& mode = gestures[i].lookup("mode");
|
||||||
|
if(mode.getType() == libconfig::Setting::TypeString) {
|
||||||
|
std::string mode_str = mode;
|
||||||
|
std::transform(mode_str.begin(), mode_str.end(),
|
||||||
|
mode_str.begin(), ::tolower);
|
||||||
|
if(mode_str == "nopress") // No action
|
||||||
|
continue;
|
||||||
|
else if(mode_str != "onrelease")
|
||||||
|
logPrintf(WARN, "Line %d: Only NoPress and "
|
||||||
|
"OnRelease are supported for the "
|
||||||
|
"None direction, defaulting to "
|
||||||
|
"OnRelease.", mode.getSourceLine());
|
||||||
|
} else {
|
||||||
|
logPrintf(WARN, "Line %d: mode must be a string, "
|
||||||
|
"defaulting to OnRelease",
|
||||||
|
mode.getSourceLine());
|
||||||
|
}
|
||||||
|
} catch(libconfig::SettingNotFoundException& e) {
|
||||||
|
// Default to OnRelease
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_none_action = Action::makeAction(_device,
|
_none_action = Action::makeAction(_device,
|
||||||
gestures[i].lookup("action"));
|
gestures[i].lookup("action"));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user