Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: gebaar-0.1.5
@ 2022-05-07 15:48 nadevko
  2022-05-07 17:18 ` [PR PATCH] [Updated] " nadevko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nadevko @ 2022-05-07 15:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

There is a new pull request by nadevko against master on the void-packages repository

https://github.com/nadevko/void-packages gebaar
https://github.com/void-linux/void-packages/pull/37024

New package: gebaar-0.1.5
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

A patch file from https://github.com/void-linux/void-packages/pull/37024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gebaar-37024.patch --]
[-- Type: text/x-diff, Size: 7229 bytes --]

From a2b4102ed16d5b710ad715052df624f37da3ad43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nade=C5=ADka?= <nadevko@riseup.net>
Date: Sat, 7 May 2022 17:32:06 +0300
Subject: [PATCH] New package: gebaar-0.1.5

---
 srcpkgs/gebaar/files/gebaar/run               |   2 +
 ...0001-Add-tablet-pen-button-remapping.patch | 167 ++++++++++++++++++
 srcpkgs/gebaar/template                       |  20 +++
 3 files changed, 189 insertions(+)
 create mode 100644 srcpkgs/gebaar/files/gebaar/run
 create mode 100644 srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
 create mode 100644 srcpkgs/gebaar/template

diff --git a/srcpkgs/gebaar/files/gebaar/run b/srcpkgs/gebaar/files/gebaar/run
new file mode 100644
index 000000000000..74315f09ee63
--- /dev/null
+++ b/srcpkgs/gebaar/files/gebaar/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec gebaard
diff --git a/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
new file mode 100644
index 000000000000..92ec1dd51f07
--- /dev/null
+++ b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
@@ -0,0 +1,167 @@
+From 1c883a01a016f632d9636de289150fb05bd8c4b3 Mon Sep 17 00:00:00 2001
+From: Aleix Quintana Alsius <kinta@communia.org>
+Date: Sun, 9 Jan 2022 17:59:19 +0100
+Subject: [PATCH] Add tablet pen button remapping
+
+---
+ src/config/config.cpp |  3 +++
+ src/config/config.h   |  2 ++
+ src/io/input.cpp      | 43 +++++++++++++++++++++++++++++++++++++++++++
+ src/io/input.h        | 12 ++++++++++++
+ 4 files changed, 60 insertions(+)
+
+diff --git a/src/config/config.cpp b/src/config/config.cpp
+index 0bbd0cc..b98e60f 100644
+--- a/src/config/config.cpp
++++ b/src/config/config.cpp
+@@ -74,6 +74,9 @@ void gebaar::config::Config::load_config()
+             settings.pinch_threshold = config->get_qualified_as<double>("pinch.settings.threshold").value_or(0.25);
+             settings.pinch_one_shot = config->get_qualified_as<bool>("pinch.settings.one_shot").value_or(false);
+ 
++            /* pen button settings */
++            pen_button_commands = *config->get_qualified_as<std::string>("pen_button.commands.command");
++            settings.pen_button_trigger_on_release = config->get_qualified_as<bool>("pen_button.settings.trigger_on_release").value_or(true);
+ 
+             loaded = true;
+         }
+diff --git a/src/config/config.h b/src/config/config.h
+index 34d7a42..c28fc2b 100644
+--- a/src/config/config.h
++++ b/src/config/config.h
+@@ -41,12 +41,14 @@ namespace gebaar::config {
+           bool swipe_one_shot;
+           double swipe_threshold;
+           bool swipe_trigger_on_release;
++          bool pen_button_trigger_on_release;
+         } settings;
+ 
+         enum pinch {PINCH_IN, PINCH_OUT};
+         std::string swipe_three_commands[10];
+         std::string swipe_four_commands[10];
+         std::string pinch_commands[10];
++        std::string pen_button_commands;
+ 
+     private:
+ 
+diff --git a/src/io/input.cpp b/src/io/input.cpp
+index 415fdab..73fdb47 100644
+--- a/src/io/input.cpp
++++ b/src/io/input.cpp
+@@ -30,6 +30,8 @@ gebaar::io::Input::Input(
+   config = config_ptr;
+   gesture_swipe_event = {};
+ 
++  pen_button_event = {};
++
+   gesture_pinch_event = {};
+   gesture_pinch_event.scale = DEFAULT_SCALE;
+ }
+@@ -62,6 +64,13 @@ void gebaar::io::Input::reset_pinch_event() {
+   gesture_pinch_event.executed = false;
+ }
+ 
++/**
++ * Reset pen button event struct to defaults
++ */
++void gebaar::io::Input::reset_pen_button_event() {
++  pen_button_event = {};
++}
++
+ /**
+  * Pinch one_shot gesture handle
+  * @param new_scale last reported scale between the fingers
+@@ -149,6 +158,30 @@ void gebaar::io::Input::handle_swipe_event_without_coords(
+   }
+ }
+ 
++/**
++ * This event has no coordinates, so it's an event that gives us a begin or end
++ * signal. If it begins, we get the amount of fingers used. If it ends, we check
++ * what kind of gesture we received.
++ *
++ * @param gev Gesture Event
++ * @param begin Boolean to denote begin or end of gesture
++ */
++void gebaar::io::Input::handle_pen_button_event_without_coords(
++    libinput_event_tablet_tool *ttev) {
++    pen_button_event.state = libinput_event_tablet_tool_get_button_state(ttev);
++
++    if (config->settings.pen_button_trigger_on_release) {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_RELEASED) {
++          trigger_pen_button_command();
++        }
++    } else {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_PRESSED) {
++          trigger_pen_button_command();
++        }
++    }
++    reset_pen_button_event();
++}
++
+ /**
+  * Swipe events with coordinates, add it to the current tally
+  * @param gev Gesture Event
+@@ -212,6 +245,13 @@ void gebaar::io::Input::trigger_swipe_command() {
+   }
+ }
+ 
++/**
++ * Making calculation for swipe direction and triggering
++ * command accordingly
++ */
++void gebaar::io::Input::trigger_pen_button_command() {
++  std::system(config->pen_button_commands.c_str());
++}
+ /**
+  * Initialize the input system
+  * @return bool
+@@ -320,6 +360,9 @@ void gebaar::io::Input::handle_event() {
+     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
+       break;
+     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
++      handle_pen_button_event_without_coords(
++          libinput_event_get_tablet_tool_event(libinput_event));
++
+       break;
+     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
+       break;
+diff --git a/src/io/input.h b/src/io/input.h
+index 2f62a29..5937690 100644
+--- a/src/io/input.h
++++ b/src/io/input.h
+@@ -47,6 +47,10 @@ namespace gebaar::io {
+         int step;
+     };
+ 
++    struct pen_button_event {
++        bool state;
++    };
++
+     class Input {
+     public:
+         Input(std::shared_ptr<gebaar::config::Config> const& config_ptr);
+@@ -66,6 +70,7 @@ namespace gebaar::io {
+ 
+         struct gesture_swipe_event gesture_swipe_event;
+         struct gesture_pinch_event gesture_pinch_event;
++        struct pen_button_event pen_button_event;
+ 
+         bool initialize_context();
+ 
+@@ -119,6 +124,13 @@ namespace gebaar::io {
+ 
+         void handle_pinch_event(libinput_event_gesture* gev, bool begin);
+ 
++
++        void trigger_pen_button_command();
++
++        void handle_pen_button_event_without_coords(libinput_event_tablet_tool* ttev);
++
++        void reset_pen_button_event();
++
+     };
+ }
+ 
+-- 
+2.36.0
+
diff --git a/srcpkgs/gebaar/template b/srcpkgs/gebaar/template
new file mode 100644
index 000000000000..00a102978b9a
--- /dev/null
+++ b/srcpkgs/gebaar/template
@@ -0,0 +1,20 @@
+# Template file for 'gebaar'
+pkgname=gebaar
+version=0.1.5
+revision=1
+wrksrc=gebaar-libinput-fork-$version
+build_style=cmake
+hostmakedepends=pkg-config
+makedepends=libinput-devel
+short_desc="wm-independent touchpad gesture daemon for libinput"
+maintainer="Nadeŭka <nadevko@riseup.net>"
+license=GPL-3.0-or-later
+homepage=https://github.com/9ary/gebaar-libinput-fork
+distfiles=https://github.com/9ary/gebaar-libinput-fork/archive/refs/tags/v$version.tar.gz
+checksum=54ac5734353492cdbc0315ec7684c46890def1aa978c66880e78a961b196feab
+
+pre_install() {
+	vsv gebaar
+	vlicense LICENSE
+	vdoc README.md
+}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] New package: gebaar-0.1.5
  2022-05-07 15:48 [PR PATCH] New package: gebaar-0.1.5 nadevko
@ 2022-05-07 17:18 ` nadevko
  2022-05-07 17:47 ` nadevko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: nadevko @ 2022-05-07 17:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

There is an updated pull request by nadevko against master on the void-packages repository

https://github.com/nadevko/void-packages gebaar
https://github.com/void-linux/void-packages/pull/37024

New package: gebaar-0.1.5
#### Testing the changes
- I tested the changes in this PR: **NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

A patch file from https://github.com/void-linux/void-packages/pull/37024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gebaar-37024.patch --]
[-- Type: text/x-diff, Size: 6882 bytes --]

From 92618398fbd8b60b09475f5fe8d072ad4e3560ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nade=C5=ADka?= <nadevko@riseup.net>
Date: Sat, 7 May 2022 17:32:06 +0300
Subject: [PATCH] New package: gebaar-0.1.5

---
 ...0001-Add-tablet-pen-button-remapping.patch | 167 ++++++++++++++++++
 srcpkgs/gebaar/template                       |  19 ++
 2 files changed, 186 insertions(+)
 create mode 100644 srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
 create mode 100644 srcpkgs/gebaar/template

diff --git a/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
new file mode 100644
index 000000000000..92ec1dd51f07
--- /dev/null
+++ b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
@@ -0,0 +1,167 @@
+From 1c883a01a016f632d9636de289150fb05bd8c4b3 Mon Sep 17 00:00:00 2001
+From: Aleix Quintana Alsius <kinta@communia.org>
+Date: Sun, 9 Jan 2022 17:59:19 +0100
+Subject: [PATCH] Add tablet pen button remapping
+
+---
+ src/config/config.cpp |  3 +++
+ src/config/config.h   |  2 ++
+ src/io/input.cpp      | 43 +++++++++++++++++++++++++++++++++++++++++++
+ src/io/input.h        | 12 ++++++++++++
+ 4 files changed, 60 insertions(+)
+
+diff --git a/src/config/config.cpp b/src/config/config.cpp
+index 0bbd0cc..b98e60f 100644
+--- a/src/config/config.cpp
++++ b/src/config/config.cpp
+@@ -74,6 +74,9 @@ void gebaar::config::Config::load_config()
+             settings.pinch_threshold = config->get_qualified_as<double>("pinch.settings.threshold").value_or(0.25);
+             settings.pinch_one_shot = config->get_qualified_as<bool>("pinch.settings.one_shot").value_or(false);
+ 
++            /* pen button settings */
++            pen_button_commands = *config->get_qualified_as<std::string>("pen_button.commands.command");
++            settings.pen_button_trigger_on_release = config->get_qualified_as<bool>("pen_button.settings.trigger_on_release").value_or(true);
+ 
+             loaded = true;
+         }
+diff --git a/src/config/config.h b/src/config/config.h
+index 34d7a42..c28fc2b 100644
+--- a/src/config/config.h
++++ b/src/config/config.h
+@@ -41,12 +41,14 @@ namespace gebaar::config {
+           bool swipe_one_shot;
+           double swipe_threshold;
+           bool swipe_trigger_on_release;
++          bool pen_button_trigger_on_release;
+         } settings;
+ 
+         enum pinch {PINCH_IN, PINCH_OUT};
+         std::string swipe_three_commands[10];
+         std::string swipe_four_commands[10];
+         std::string pinch_commands[10];
++        std::string pen_button_commands;
+ 
+     private:
+ 
+diff --git a/src/io/input.cpp b/src/io/input.cpp
+index 415fdab..73fdb47 100644
+--- a/src/io/input.cpp
++++ b/src/io/input.cpp
+@@ -30,6 +30,8 @@ gebaar::io::Input::Input(
+   config = config_ptr;
+   gesture_swipe_event = {};
+ 
++  pen_button_event = {};
++
+   gesture_pinch_event = {};
+   gesture_pinch_event.scale = DEFAULT_SCALE;
+ }
+@@ -62,6 +64,13 @@ void gebaar::io::Input::reset_pinch_event() {
+   gesture_pinch_event.executed = false;
+ }
+ 
++/**
++ * Reset pen button event struct to defaults
++ */
++void gebaar::io::Input::reset_pen_button_event() {
++  pen_button_event = {};
++}
++
+ /**
+  * Pinch one_shot gesture handle
+  * @param new_scale last reported scale between the fingers
+@@ -149,6 +158,30 @@ void gebaar::io::Input::handle_swipe_event_without_coords(
+   }
+ }
+ 
++/**
++ * This event has no coordinates, so it's an event that gives us a begin or end
++ * signal. If it begins, we get the amount of fingers used. If it ends, we check
++ * what kind of gesture we received.
++ *
++ * @param gev Gesture Event
++ * @param begin Boolean to denote begin or end of gesture
++ */
++void gebaar::io::Input::handle_pen_button_event_without_coords(
++    libinput_event_tablet_tool *ttev) {
++    pen_button_event.state = libinput_event_tablet_tool_get_button_state(ttev);
++
++    if (config->settings.pen_button_trigger_on_release) {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_RELEASED) {
++          trigger_pen_button_command();
++        }
++    } else {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_PRESSED) {
++          trigger_pen_button_command();
++        }
++    }
++    reset_pen_button_event();
++}
++
+ /**
+  * Swipe events with coordinates, add it to the current tally
+  * @param gev Gesture Event
+@@ -212,6 +245,13 @@ void gebaar::io::Input::trigger_swipe_command() {
+   }
+ }
+ 
++/**
++ * Making calculation for swipe direction and triggering
++ * command accordingly
++ */
++void gebaar::io::Input::trigger_pen_button_command() {
++  std::system(config->pen_button_commands.c_str());
++}
+ /**
+  * Initialize the input system
+  * @return bool
+@@ -320,6 +360,9 @@ void gebaar::io::Input::handle_event() {
+     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
+       break;
+     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
++      handle_pen_button_event_without_coords(
++          libinput_event_get_tablet_tool_event(libinput_event));
++
+       break;
+     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
+       break;
+diff --git a/src/io/input.h b/src/io/input.h
+index 2f62a29..5937690 100644
+--- a/src/io/input.h
++++ b/src/io/input.h
+@@ -47,6 +47,10 @@ namespace gebaar::io {
+         int step;
+     };
+ 
++    struct pen_button_event {
++        bool state;
++    };
++
+     class Input {
+     public:
+         Input(std::shared_ptr<gebaar::config::Config> const& config_ptr);
+@@ -66,6 +70,7 @@ namespace gebaar::io {
+ 
+         struct gesture_swipe_event gesture_swipe_event;
+         struct gesture_pinch_event gesture_pinch_event;
++        struct pen_button_event pen_button_event;
+ 
+         bool initialize_context();
+ 
+@@ -119,6 +124,13 @@ namespace gebaar::io {
+ 
+         void handle_pinch_event(libinput_event_gesture* gev, bool begin);
+ 
++
++        void trigger_pen_button_command();
++
++        void handle_pen_button_event_without_coords(libinput_event_tablet_tool* ttev);
++
++        void reset_pen_button_event();
++
+     };
+ }
+ 
+-- 
+2.36.0
+
diff --git a/srcpkgs/gebaar/template b/srcpkgs/gebaar/template
new file mode 100644
index 000000000000..c2406eae71fa
--- /dev/null
+++ b/srcpkgs/gebaar/template
@@ -0,0 +1,19 @@
+# Template file for 'gebaar'
+pkgname=gebaar
+version=0.1.5
+revision=1
+wrksrc=gebaar-libinput-fork-$version
+build_style=cmake
+hostmakedepends=pkg-config
+makedepends=libinput-devel
+short_desc="wm-independent touchpad gesture daemon for libinput"
+maintainer="Nadeŭka <nadevko@riseup.net>"
+license=GPL-3.0-or-later
+homepage=https://github.com/9ary/gebaar-libinput-fork
+distfiles=https://github.com/9ary/gebaar-libinput-fork/archive/refs/tags/v$version.tar.gz
+checksum=54ac5734353492cdbc0315ec7684c46890def1aa978c66880e78a961b196feab
+
+pre_install() {
+	vlicense LICENSE
+	vdoc README.md
+}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] New package: gebaar-0.1.5
  2022-05-07 15:48 [PR PATCH] New package: gebaar-0.1.5 nadevko
  2022-05-07 17:18 ` [PR PATCH] [Updated] " nadevko
@ 2022-05-07 17:47 ` nadevko
  2022-05-08 12:19 ` nadevko
  2022-05-19 12:56 ` nadevko
  3 siblings, 0 replies; 5+ messages in thread
From: nadevko @ 2022-05-07 17:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

There is an updated pull request by nadevko against master on the void-packages repository

https://github.com/nadevko/void-packages gebaar
https://github.com/void-linux/void-packages/pull/37024

New package: gebaar-0.1.5
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

A patch file from https://github.com/void-linux/void-packages/pull/37024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gebaar-37024.patch --]
[-- Type: text/x-diff, Size: 6882 bytes --]

From 9da00f4d327e5471e255787b2fdd31af8ca0c70e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nade=C5=ADka?= <nadevko@riseup.net>
Date: Sat, 7 May 2022 17:32:06 +0300
Subject: [PATCH] New package: gebaar-0.1.5

---
 ...0001-Add-tablet-pen-button-remapping.patch | 167 ++++++++++++++++++
 srcpkgs/gebaar/template                       |  19 ++
 2 files changed, 186 insertions(+)
 create mode 100644 srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
 create mode 100644 srcpkgs/gebaar/template

diff --git a/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
new file mode 100644
index 000000000000..92ec1dd51f07
--- /dev/null
+++ b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
@@ -0,0 +1,167 @@
+From 1c883a01a016f632d9636de289150fb05bd8c4b3 Mon Sep 17 00:00:00 2001
+From: Aleix Quintana Alsius <kinta@communia.org>
+Date: Sun, 9 Jan 2022 17:59:19 +0100
+Subject: [PATCH] Add tablet pen button remapping
+
+---
+ src/config/config.cpp |  3 +++
+ src/config/config.h   |  2 ++
+ src/io/input.cpp      | 43 +++++++++++++++++++++++++++++++++++++++++++
+ src/io/input.h        | 12 ++++++++++++
+ 4 files changed, 60 insertions(+)
+
+diff --git a/src/config/config.cpp b/src/config/config.cpp
+index 0bbd0cc..b98e60f 100644
+--- a/src/config/config.cpp
++++ b/src/config/config.cpp
+@@ -74,6 +74,9 @@ void gebaar::config::Config::load_config()
+             settings.pinch_threshold = config->get_qualified_as<double>("pinch.settings.threshold").value_or(0.25);
+             settings.pinch_one_shot = config->get_qualified_as<bool>("pinch.settings.one_shot").value_or(false);
+ 
++            /* pen button settings */
++            pen_button_commands = *config->get_qualified_as<std::string>("pen_button.commands.command");
++            settings.pen_button_trigger_on_release = config->get_qualified_as<bool>("pen_button.settings.trigger_on_release").value_or(true);
+ 
+             loaded = true;
+         }
+diff --git a/src/config/config.h b/src/config/config.h
+index 34d7a42..c28fc2b 100644
+--- a/src/config/config.h
++++ b/src/config/config.h
+@@ -41,12 +41,14 @@ namespace gebaar::config {
+           bool swipe_one_shot;
+           double swipe_threshold;
+           bool swipe_trigger_on_release;
++          bool pen_button_trigger_on_release;
+         } settings;
+ 
+         enum pinch {PINCH_IN, PINCH_OUT};
+         std::string swipe_three_commands[10];
+         std::string swipe_four_commands[10];
+         std::string pinch_commands[10];
++        std::string pen_button_commands;
+ 
+     private:
+ 
+diff --git a/src/io/input.cpp b/src/io/input.cpp
+index 415fdab..73fdb47 100644
+--- a/src/io/input.cpp
++++ b/src/io/input.cpp
+@@ -30,6 +30,8 @@ gebaar::io::Input::Input(
+   config = config_ptr;
+   gesture_swipe_event = {};
+ 
++  pen_button_event = {};
++
+   gesture_pinch_event = {};
+   gesture_pinch_event.scale = DEFAULT_SCALE;
+ }
+@@ -62,6 +64,13 @@ void gebaar::io::Input::reset_pinch_event() {
+   gesture_pinch_event.executed = false;
+ }
+ 
++/**
++ * Reset pen button event struct to defaults
++ */
++void gebaar::io::Input::reset_pen_button_event() {
++  pen_button_event = {};
++}
++
+ /**
+  * Pinch one_shot gesture handle
+  * @param new_scale last reported scale between the fingers
+@@ -149,6 +158,30 @@ void gebaar::io::Input::handle_swipe_event_without_coords(
+   }
+ }
+ 
++/**
++ * This event has no coordinates, so it's an event that gives us a begin or end
++ * signal. If it begins, we get the amount of fingers used. If it ends, we check
++ * what kind of gesture we received.
++ *
++ * @param gev Gesture Event
++ * @param begin Boolean to denote begin or end of gesture
++ */
++void gebaar::io::Input::handle_pen_button_event_without_coords(
++    libinput_event_tablet_tool *ttev) {
++    pen_button_event.state = libinput_event_tablet_tool_get_button_state(ttev);
++
++    if (config->settings.pen_button_trigger_on_release) {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_RELEASED) {
++          trigger_pen_button_command();
++        }
++    } else {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_PRESSED) {
++          trigger_pen_button_command();
++        }
++    }
++    reset_pen_button_event();
++}
++
+ /**
+  * Swipe events with coordinates, add it to the current tally
+  * @param gev Gesture Event
+@@ -212,6 +245,13 @@ void gebaar::io::Input::trigger_swipe_command() {
+   }
+ }
+ 
++/**
++ * Making calculation for swipe direction and triggering
++ * command accordingly
++ */
++void gebaar::io::Input::trigger_pen_button_command() {
++  std::system(config->pen_button_commands.c_str());
++}
+ /**
+  * Initialize the input system
+  * @return bool
+@@ -320,6 +360,9 @@ void gebaar::io::Input::handle_event() {
+     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
+       break;
+     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
++      handle_pen_button_event_without_coords(
++          libinput_event_get_tablet_tool_event(libinput_event));
++
+       break;
+     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
+       break;
+diff --git a/src/io/input.h b/src/io/input.h
+index 2f62a29..5937690 100644
+--- a/src/io/input.h
++++ b/src/io/input.h
+@@ -47,6 +47,10 @@ namespace gebaar::io {
+         int step;
+     };
+ 
++    struct pen_button_event {
++        bool state;
++    };
++
+     class Input {
+     public:
+         Input(std::shared_ptr<gebaar::config::Config> const& config_ptr);
+@@ -66,6 +70,7 @@ namespace gebaar::io {
+ 
+         struct gesture_swipe_event gesture_swipe_event;
+         struct gesture_pinch_event gesture_pinch_event;
++        struct pen_button_event pen_button_event;
+ 
+         bool initialize_context();
+ 
+@@ -119,6 +124,13 @@ namespace gebaar::io {
+ 
+         void handle_pinch_event(libinput_event_gesture* gev, bool begin);
+ 
++
++        void trigger_pen_button_command();
++
++        void handle_pen_button_event_without_coords(libinput_event_tablet_tool* ttev);
++
++        void reset_pen_button_event();
++
+     };
+ }
+ 
+-- 
+2.36.0
+
diff --git a/srcpkgs/gebaar/template b/srcpkgs/gebaar/template
new file mode 100644
index 000000000000..75499d05539f
--- /dev/null
+++ b/srcpkgs/gebaar/template
@@ -0,0 +1,19 @@
+# Template file for 'gebaar'
+pkgname=gebaar
+version=0.1.5
+revision=1
+wrksrc=gebaar-libinput-fork-$version
+build_style=cmake
+hostmakedepends=pkg-config
+makedepends=libinput-devel
+short_desc="WM-independent touchpad gesture daemon for libinput"
+maintainer="Nadeŭka <nadevko@riseup.net>"
+license=GPL-3.0-or-later
+homepage=https://github.com/9ary/gebaar-libinput-fork
+distfiles=https://github.com/9ary/gebaar-libinput-fork/archive/refs/tags/v$version.tar.gz
+checksum=54ac5734353492cdbc0315ec7684c46890def1aa978c66880e78a961b196feab
+
+pre_install() {
+	vlicense LICENSE
+	vdoc README.md
+}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] New package: gebaar-0.1.5
  2022-05-07 15:48 [PR PATCH] New package: gebaar-0.1.5 nadevko
  2022-05-07 17:18 ` [PR PATCH] [Updated] " nadevko
  2022-05-07 17:47 ` nadevko
@ 2022-05-08 12:19 ` nadevko
  2022-05-19 12:56 ` nadevko
  3 siblings, 0 replies; 5+ messages in thread
From: nadevko @ 2022-05-08 12:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

There is an updated pull request by nadevko against master on the void-packages repository

https://github.com/nadevko/void-packages gebaar
https://github.com/void-linux/void-packages/pull/37024

New package: gebaar-0.1.5
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

A patch file from https://github.com/void-linux/void-packages/pull/37024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gebaar-37024.patch --]
[-- Type: text/x-diff, Size: 6882 bytes --]

From b4589b4f2f705c82a291154a7ce0395405bc8d29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nade=C5=ADka?= <nadevko@riseup.net>
Date: Sat, 7 May 2022 17:32:06 +0300
Subject: [PATCH] New package: gebaar-0.1.5

---
 ...0001-Add-tablet-pen-button-remapping.patch | 167 ++++++++++++++++++
 srcpkgs/gebaar/template                       |  19 ++
 2 files changed, 186 insertions(+)
 create mode 100644 srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
 create mode 100644 srcpkgs/gebaar/template

diff --git a/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
new file mode 100644
index 000000000000..92ec1dd51f07
--- /dev/null
+++ b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
@@ -0,0 +1,167 @@
+From 1c883a01a016f632d9636de289150fb05bd8c4b3 Mon Sep 17 00:00:00 2001
+From: Aleix Quintana Alsius <kinta@communia.org>
+Date: Sun, 9 Jan 2022 17:59:19 +0100
+Subject: [PATCH] Add tablet pen button remapping
+
+---
+ src/config/config.cpp |  3 +++
+ src/config/config.h   |  2 ++
+ src/io/input.cpp      | 43 +++++++++++++++++++++++++++++++++++++++++++
+ src/io/input.h        | 12 ++++++++++++
+ 4 files changed, 60 insertions(+)
+
+diff --git a/src/config/config.cpp b/src/config/config.cpp
+index 0bbd0cc..b98e60f 100644
+--- a/src/config/config.cpp
++++ b/src/config/config.cpp
+@@ -74,6 +74,9 @@ void gebaar::config::Config::load_config()
+             settings.pinch_threshold = config->get_qualified_as<double>("pinch.settings.threshold").value_or(0.25);
+             settings.pinch_one_shot = config->get_qualified_as<bool>("pinch.settings.one_shot").value_or(false);
+ 
++            /* pen button settings */
++            pen_button_commands = *config->get_qualified_as<std::string>("pen_button.commands.command");
++            settings.pen_button_trigger_on_release = config->get_qualified_as<bool>("pen_button.settings.trigger_on_release").value_or(true);
+ 
+             loaded = true;
+         }
+diff --git a/src/config/config.h b/src/config/config.h
+index 34d7a42..c28fc2b 100644
+--- a/src/config/config.h
++++ b/src/config/config.h
+@@ -41,12 +41,14 @@ namespace gebaar::config {
+           bool swipe_one_shot;
+           double swipe_threshold;
+           bool swipe_trigger_on_release;
++          bool pen_button_trigger_on_release;
+         } settings;
+ 
+         enum pinch {PINCH_IN, PINCH_OUT};
+         std::string swipe_three_commands[10];
+         std::string swipe_four_commands[10];
+         std::string pinch_commands[10];
++        std::string pen_button_commands;
+ 
+     private:
+ 
+diff --git a/src/io/input.cpp b/src/io/input.cpp
+index 415fdab..73fdb47 100644
+--- a/src/io/input.cpp
++++ b/src/io/input.cpp
+@@ -30,6 +30,8 @@ gebaar::io::Input::Input(
+   config = config_ptr;
+   gesture_swipe_event = {};
+ 
++  pen_button_event = {};
++
+   gesture_pinch_event = {};
+   gesture_pinch_event.scale = DEFAULT_SCALE;
+ }
+@@ -62,6 +64,13 @@ void gebaar::io::Input::reset_pinch_event() {
+   gesture_pinch_event.executed = false;
+ }
+ 
++/**
++ * Reset pen button event struct to defaults
++ */
++void gebaar::io::Input::reset_pen_button_event() {
++  pen_button_event = {};
++}
++
+ /**
+  * Pinch one_shot gesture handle
+  * @param new_scale last reported scale between the fingers
+@@ -149,6 +158,30 @@ void gebaar::io::Input::handle_swipe_event_without_coords(
+   }
+ }
+ 
++/**
++ * This event has no coordinates, so it's an event that gives us a begin or end
++ * signal. If it begins, we get the amount of fingers used. If it ends, we check
++ * what kind of gesture we received.
++ *
++ * @param gev Gesture Event
++ * @param begin Boolean to denote begin or end of gesture
++ */
++void gebaar::io::Input::handle_pen_button_event_without_coords(
++    libinput_event_tablet_tool *ttev) {
++    pen_button_event.state = libinput_event_tablet_tool_get_button_state(ttev);
++
++    if (config->settings.pen_button_trigger_on_release) {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_RELEASED) {
++          trigger_pen_button_command();
++        }
++    } else {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_PRESSED) {
++          trigger_pen_button_command();
++        }
++    }
++    reset_pen_button_event();
++}
++
+ /**
+  * Swipe events with coordinates, add it to the current tally
+  * @param gev Gesture Event
+@@ -212,6 +245,13 @@ void gebaar::io::Input::trigger_swipe_command() {
+   }
+ }
+ 
++/**
++ * Making calculation for swipe direction and triggering
++ * command accordingly
++ */
++void gebaar::io::Input::trigger_pen_button_command() {
++  std::system(config->pen_button_commands.c_str());
++}
+ /**
+  * Initialize the input system
+  * @return bool
+@@ -320,6 +360,9 @@ void gebaar::io::Input::handle_event() {
+     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
+       break;
+     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
++      handle_pen_button_event_without_coords(
++          libinput_event_get_tablet_tool_event(libinput_event));
++
+       break;
+     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
+       break;
+diff --git a/src/io/input.h b/src/io/input.h
+index 2f62a29..5937690 100644
+--- a/src/io/input.h
++++ b/src/io/input.h
+@@ -47,6 +47,10 @@ namespace gebaar::io {
+         int step;
+     };
+ 
++    struct pen_button_event {
++        bool state;
++    };
++
+     class Input {
+     public:
+         Input(std::shared_ptr<gebaar::config::Config> const& config_ptr);
+@@ -66,6 +70,7 @@ namespace gebaar::io {
+ 
+         struct gesture_swipe_event gesture_swipe_event;
+         struct gesture_pinch_event gesture_pinch_event;
++        struct pen_button_event pen_button_event;
+ 
+         bool initialize_context();
+ 
+@@ -119,6 +124,13 @@ namespace gebaar::io {
+ 
+         void handle_pinch_event(libinput_event_gesture* gev, bool begin);
+ 
++
++        void trigger_pen_button_command();
++
++        void handle_pen_button_event_without_coords(libinput_event_tablet_tool* ttev);
++
++        void reset_pen_button_event();
++
+     };
+ }
+ 
+-- 
+2.36.0
+
diff --git a/srcpkgs/gebaar/template b/srcpkgs/gebaar/template
new file mode 100644
index 000000000000..75499d05539f
--- /dev/null
+++ b/srcpkgs/gebaar/template
@@ -0,0 +1,19 @@
+# Template file for 'gebaar'
+pkgname=gebaar
+version=0.1.5
+revision=1
+wrksrc=gebaar-libinput-fork-$version
+build_style=cmake
+hostmakedepends=pkg-config
+makedepends=libinput-devel
+short_desc="WM-independent touchpad gesture daemon for libinput"
+maintainer="Nadeŭka <nadevko@riseup.net>"
+license=GPL-3.0-or-later
+homepage=https://github.com/9ary/gebaar-libinput-fork
+distfiles=https://github.com/9ary/gebaar-libinput-fork/archive/refs/tags/v$version.tar.gz
+checksum=54ac5734353492cdbc0315ec7684c46890def1aa978c66880e78a961b196feab
+
+pre_install() {
+	vlicense LICENSE
+	vdoc README.md
+}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] New package: gebaar-0.1.5
  2022-05-07 15:48 [PR PATCH] New package: gebaar-0.1.5 nadevko
                   ` (2 preceding siblings ...)
  2022-05-08 12:19 ` nadevko
@ 2022-05-19 12:56 ` nadevko
  3 siblings, 0 replies; 5+ messages in thread
From: nadevko @ 2022-05-19 12:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

There is an updated pull request by nadevko against master on the void-packages repository

https://github.com/nadevko/void-packages gebaar
https://github.com/void-linux/void-packages/pull/37024

New package: gebaar-0.1.5
#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

A patch file from https://github.com/void-linux/void-packages/pull/37024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gebaar-37024.patch --]
[-- Type: text/x-diff, Size: 6847 bytes --]

From 2cb6513fa892d38c13fa938f5bbc7664d8a68069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nade=C5=ADka?= <nadevko@riseup.net>
Date: Sat, 7 May 2022 17:32:06 +0300
Subject: [PATCH] New package: gebaar-0.1.5

---
 ...0001-Add-tablet-pen-button-remapping.patch | 167 ++++++++++++++++++
 srcpkgs/gebaar/template                       |  19 ++
 2 files changed, 186 insertions(+)
 create mode 100644 srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
 create mode 100644 srcpkgs/gebaar/template

diff --git a/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
new file mode 100644
index 000000000000..92ec1dd51f07
--- /dev/null
+++ b/srcpkgs/gebaar/patch/0001-Add-tablet-pen-button-remapping.patch
@@ -0,0 +1,167 @@
+From 1c883a01a016f632d9636de289150fb05bd8c4b3 Mon Sep 17 00:00:00 2001
+From: Aleix Quintana Alsius <kinta@communia.org>
+Date: Sun, 9 Jan 2022 17:59:19 +0100
+Subject: [PATCH] Add tablet pen button remapping
+
+---
+ src/config/config.cpp |  3 +++
+ src/config/config.h   |  2 ++
+ src/io/input.cpp      | 43 +++++++++++++++++++++++++++++++++++++++++++
+ src/io/input.h        | 12 ++++++++++++
+ 4 files changed, 60 insertions(+)
+
+diff --git a/src/config/config.cpp b/src/config/config.cpp
+index 0bbd0cc..b98e60f 100644
+--- a/src/config/config.cpp
++++ b/src/config/config.cpp
+@@ -74,6 +74,9 @@ void gebaar::config::Config::load_config()
+             settings.pinch_threshold = config->get_qualified_as<double>("pinch.settings.threshold").value_or(0.25);
+             settings.pinch_one_shot = config->get_qualified_as<bool>("pinch.settings.one_shot").value_or(false);
+ 
++            /* pen button settings */
++            pen_button_commands = *config->get_qualified_as<std::string>("pen_button.commands.command");
++            settings.pen_button_trigger_on_release = config->get_qualified_as<bool>("pen_button.settings.trigger_on_release").value_or(true);
+ 
+             loaded = true;
+         }
+diff --git a/src/config/config.h b/src/config/config.h
+index 34d7a42..c28fc2b 100644
+--- a/src/config/config.h
++++ b/src/config/config.h
+@@ -41,12 +41,14 @@ namespace gebaar::config {
+           bool swipe_one_shot;
+           double swipe_threshold;
+           bool swipe_trigger_on_release;
++          bool pen_button_trigger_on_release;
+         } settings;
+ 
+         enum pinch {PINCH_IN, PINCH_OUT};
+         std::string swipe_three_commands[10];
+         std::string swipe_four_commands[10];
+         std::string pinch_commands[10];
++        std::string pen_button_commands;
+ 
+     private:
+ 
+diff --git a/src/io/input.cpp b/src/io/input.cpp
+index 415fdab..73fdb47 100644
+--- a/src/io/input.cpp
++++ b/src/io/input.cpp
+@@ -30,6 +30,8 @@ gebaar::io::Input::Input(
+   config = config_ptr;
+   gesture_swipe_event = {};
+ 
++  pen_button_event = {};
++
+   gesture_pinch_event = {};
+   gesture_pinch_event.scale = DEFAULT_SCALE;
+ }
+@@ -62,6 +64,13 @@ void gebaar::io::Input::reset_pinch_event() {
+   gesture_pinch_event.executed = false;
+ }
+ 
++/**
++ * Reset pen button event struct to defaults
++ */
++void gebaar::io::Input::reset_pen_button_event() {
++  pen_button_event = {};
++}
++
+ /**
+  * Pinch one_shot gesture handle
+  * @param new_scale last reported scale between the fingers
+@@ -149,6 +158,30 @@ void gebaar::io::Input::handle_swipe_event_without_coords(
+   }
+ }
+ 
++/**
++ * This event has no coordinates, so it's an event that gives us a begin or end
++ * signal. If it begins, we get the amount of fingers used. If it ends, we check
++ * what kind of gesture we received.
++ *
++ * @param gev Gesture Event
++ * @param begin Boolean to denote begin or end of gesture
++ */
++void gebaar::io::Input::handle_pen_button_event_without_coords(
++    libinput_event_tablet_tool *ttev) {
++    pen_button_event.state = libinput_event_tablet_tool_get_button_state(ttev);
++
++    if (config->settings.pen_button_trigger_on_release) {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_RELEASED) {
++          trigger_pen_button_command();
++        }
++    } else {
++        if (pen_button_event.state == LIBINPUT_BUTTON_STATE_PRESSED) {
++          trigger_pen_button_command();
++        }
++    }
++    reset_pen_button_event();
++}
++
+ /**
+  * Swipe events with coordinates, add it to the current tally
+  * @param gev Gesture Event
+@@ -212,6 +245,13 @@ void gebaar::io::Input::trigger_swipe_command() {
+   }
+ }
+ 
++/**
++ * Making calculation for swipe direction and triggering
++ * command accordingly
++ */
++void gebaar::io::Input::trigger_pen_button_command() {
++  std::system(config->pen_button_commands.c_str());
++}
+ /**
+  * Initialize the input system
+  * @return bool
+@@ -320,6 +360,9 @@ void gebaar::io::Input::handle_event() {
+     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
+       break;
+     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
++      handle_pen_button_event_without_coords(
++          libinput_event_get_tablet_tool_event(libinput_event));
++
+       break;
+     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
+       break;
+diff --git a/src/io/input.h b/src/io/input.h
+index 2f62a29..5937690 100644
+--- a/src/io/input.h
++++ b/src/io/input.h
+@@ -47,6 +47,10 @@ namespace gebaar::io {
+         int step;
+     };
+ 
++    struct pen_button_event {
++        bool state;
++    };
++
+     class Input {
+     public:
+         Input(std::shared_ptr<gebaar::config::Config> const& config_ptr);
+@@ -66,6 +70,7 @@ namespace gebaar::io {
+ 
+         struct gesture_swipe_event gesture_swipe_event;
+         struct gesture_pinch_event gesture_pinch_event;
++        struct pen_button_event pen_button_event;
+ 
+         bool initialize_context();
+ 
+@@ -119,6 +124,13 @@ namespace gebaar::io {
+ 
+         void handle_pinch_event(libinput_event_gesture* gev, bool begin);
+ 
++
++        void trigger_pen_button_command();
++
++        void handle_pen_button_event_without_coords(libinput_event_tablet_tool* ttev);
++
++        void reset_pen_button_event();
++
+     };
+ }
+ 
+-- 
+2.36.0
+
diff --git a/srcpkgs/gebaar/template b/srcpkgs/gebaar/template
new file mode 100644
index 000000000000..41882632e736
--- /dev/null
+++ b/srcpkgs/gebaar/template
@@ -0,0 +1,19 @@
+# Template file for 'gebaar'
+pkgname=gebaar
+version=0.1.5
+revision=1
+wrksrc=gebaar-libinput-fork-$version
+build_style=cmake
+hostmakedepends=pkg-config
+makedepends=libinput-devel
+short_desc="WM-independent touchpad gesture daemon for libinput"
+maintainer="Nadeŭka <nadevko@riseup.net>"
+license=GPL-3.0-or-later
+homepage=https://github.com/9ary/gebaar-libinput-fork
+distfiles=$homepage/archive/refs/tags/v$version.tar.gz
+checksum=54ac5734353492cdbc0315ec7684c46890def1aa978c66880e78a961b196feab
+
+pre_install() {
+	vlicense LICENSE
+	vdoc README.md
+}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-19 12:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 15:48 [PR PATCH] New package: gebaar-0.1.5 nadevko
2022-05-07 17:18 ` [PR PATCH] [Updated] " nadevko
2022-05-07 17:47 ` nadevko
2022-05-08 12:19 ` nadevko
2022-05-19 12:56 ` nadevko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).