Skip to content

Commit

Permalink
Keyboard applet: Cycle layouts on middle-click
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed May 19, 2020
1 parent 1ccef7d commit 654af95
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions files/usr/share/cinnamon/applets/keyboard@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ class CinnamonKeyboardApplet extends Applet.TextIconApplet {
this._config.connect('config-changed', Lang.bind(this, this._syncConfig));
}

_onButtonPressEvent(actor, event) {
// Cycle to the next layout
if(event.get_button() === 2) {
let selected_group = this._config.get_current_group();
let new_group = (selected_group + 1) % this._layoutItems.length;
this._config.set_current_group(new_group);
}
return Applet.Applet.prototype._onButtonPressEvent.call(this, actor, event);
}

on_applet_clicked(event) {
this.menu.toggle();
}
Expand Down

0 comments on commit 654af95

Please sign in to comment.