feat(alsa): add middle and right mouse button events (#2573)

* Add events to alsa module

* Update CHANGELOG

* Update CHANGELOG.md

Closes #2566 

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
This commit is contained in:
Stefano Volpe 2022-01-18 19:51:49 +01:00 committed by GitHub
parent 968d9c753f
commit d995a39da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -73,6 +73,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `DEBUG_SHADED` cmake variable and its associated functionality. - `DEBUG_SHADED` cmake variable and its associated functionality.
### Added ### Added
- Right and middle click events for alsa module.
([`#2566`](https://github.com/polybar/polybar/issues/2566))
- `internal/network`: New token `%mac%` shows MAC address of selected interface - `internal/network`: New token `%mac%` shows MAC address of selected interface
([`#2568`](https://github.com/polybar/polybar/issues/2568)) ([`#2568`](https://github.com/polybar/polybar/issues/2568))
- Polybar can now read config files from stdin: `polybar -c /dev/stdin`. - Polybar can now read config files from stdin: `polybar -c /dev/stdin`.

View File

@ -196,6 +196,17 @@ namespace modules {
string output{module::get_output()}; string output{module::get_output()};
if (m_handle_events) { if (m_handle_events) {
auto click_middle = m_conf.get(name(), "click-middle", ""s);
auto click_right = m_conf.get(name(), "click-right", ""s);
if (!click_middle.empty()) {
m_builder->action(mousebtn::MIDDLE, click_middle);
}
if (!click_right.empty()) {
m_builder->action(mousebtn::RIGHT, click_right);
}
m_builder->action(mousebtn::LEFT, *this, EVENT_TOGGLE, ""); m_builder->action(mousebtn::LEFT, *this, EVENT_TOGGLE, "");
m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_INC, ""); m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_INC, "");
m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_DEC, ""); m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_DEC, "");