Skip to content

Commit 20f08b8

Browse files
authored
Merge pull request #2996 from rroohhh/feat/horizontal_scroll
feat: allow horizontal scroll
2 parents 214858f + 207e998 commit 20f08b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/AModule.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ AModule::AModule(const Json::Value& config, const std::string& name, const std::
5151
event_box_.add_events(Gdk::BUTTON_RELEASE_MASK);
5252
event_box_.signal_button_release_event().connect(sigc::mem_fun(*this, &AModule::handleRelease));
5353
}
54-
if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString() || enable_scroll) {
54+
if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString() ||
55+
config_["on-scroll-left"].isString() || config_["on-scroll-right"].isString() ||
56+
enable_scroll) {
5557
event_box_.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
5658
event_box_.signal_scroll_event().connect(sigc::mem_fun(*this, &AModule::handleScroll));
5759
}
@@ -179,6 +181,10 @@ bool AModule::handleScroll(GdkEventScroll* e) {
179181
eventName = "on-scroll-up";
180182
else if (dir == SCROLL_DIR::DOWN)
181183
eventName = "on-scroll-down";
184+
else if (dir == SCROLL_DIR::LEFT)
185+
eventName = "on-scroll-left";
186+
else if (dir == SCROLL_DIR::RIGHT)
187+
eventName = "on-scroll-right";
182188

183189
// First call module actions
184190
this->AModule::doAction(eventName);

0 commit comments

Comments
 (0)