Commit 1f08fa73 authored by sebt3's avatar sebt3

Added mouse_middle option for nubs click

parent 89efe3fc
......@@ -44,8 +44,8 @@ nubs.left.x = [*mouse_x*|mouse_y|mouse_btn|scroll_x|scroll_y]
nubs.left.y = [mouse_x|*mouse_y*|mouse_btn|scroll_x|scroll_y]
nubs.right.x = [mouse_x|mouse_y|*mouse_btn*|scroll_x|scroll_y]
nubs.right.y = [mouse_x|mouse_y|mouse_btn|scroll_x|*scroll_y*]
nubs.left.click = [*mouse_left*|mouse_right]
nubs.right.click = [mouse_left|*mouse_right*]
nubs.left.click = [*mouse_left*|mouse_middle|mouse_right]
nubs.right.click = [mouse_left|mouse_middle|*mouse_right*]
altmode.start.button = [*left_alt*|right_alt]
altmode.right.trigger = [left_alt|*right_alt*]
gamepad.export = 1
......
funkeymonkey-pyrainput (0.1.9) unstable; urgency=medium
[ Sébastien Huss ]
* Added mouse_middle option for nubs click
-- Pyra Dev <pyra-dev@pyra-handheld.com> Sat, 9 Jan 2021 13:01:44 +0100
funkeymonkey-pyrainput (0.1.8) unstable; urgency=medium
[ aTc ]
......
......@@ -99,7 +99,7 @@ struct Settings {
enum NubClickMode {
UNKNOWN_NUB_CLICK_MODE,
NUB_CLICK_LEFT, NUB_CLICK_RIGHT,
MOUSE_LEFT, MOUSE_RIGHT
MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT
};
enum AltMode {
LEFT_ALT, RIGHT_ALT
......@@ -150,6 +150,7 @@ NubClickModeMap const NUB_CLICK_MODES = {
{ "nub_click_left", Settings::NUB_CLICK_LEFT },
{ "nub_click_right", Settings::NUB_CLICK_RIGHT },
{ "mouse_left", Settings::MOUSE_LEFT },
{ "mouse_middle", Settings::MOUSE_MIDDLE },
{ "mouse_right", Settings::MOUSE_RIGHT }
};
......@@ -646,6 +647,14 @@ void handleNubAxis(Settings::NubAxisMode mode, int value, Mouse* mouse, UinputDe
void handleNubClick(Settings::NubClickMode mode, int value, Mouse* mouse, UinputDevice* gamepad, Settings const& settings) {
switch(mode) {
case Settings::MOUSE_MIDDLE: {
if (global.settings.exportMouse) {
std::lock_guard<std::mutex> lk(mouse->mutex);
mouse->device.send(EV_KEY, BTN_MIDDLE, value);
mouse->device.send(EV_SYN, 0, 0);
}
break;
}
case Settings::MOUSE_LEFT: {
if (global.settings.exportMouse) {
std::lock_guard<std::mutex> lk(mouse->mutex);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment