summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Zhao2015-08-08 21:03:22 +0200
committerMax Zhao2015-08-08 21:03:22 +0200
commit36d3e861664aeae36a45f96100f10f8fe2218035 (patch)
treec951db3e1b6f5b7d99ee8d4f2c86ed8ab694e86c
downloadaur-36d3e861664aeae36a45f96100f10f8fe2218035.tar.gz
Port to AUR4
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD18
-rw-r--r--vtwheel47
3 files changed, 79 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d88aa8193cf3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = urxvt-vtwheel
+ pkgdesc = Scroll wheel support for urxvt
+ pkgver = 0.3
+ pkgrel = 2
+ url = http://aur.archlinux.org/
+ arch = any
+ license = unknown
+ depends = bash
+ depends = rxvt-unicode
+ source = vtwheel
+ md5sums = 5d2fc11d40562be5721434a418c7e66f
+
+pkgname = urxvt-vtwheel
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..588f2a0e2030
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,18 @@
+# previous Maintainer: PyroPeter <abi1789 @ googlemail . com>
+# Maintainer: Alcasa <alcasa . mz @ googlemail . com>
+pkgname=urxvt-vtwheel
+pkgver=0.3
+pkgrel=2
+pkgdesc="Scroll wheel support for urxvt"
+url="http://aur.archlinux.org/"
+arch=('any')
+license=('unknown')
+depends=('bash' 'rxvt-unicode')
+source=('vtwheel')
+md5sums=('5d2fc11d40562be5721434a418c7e66f')
+
+package() {
+ install -Dm0664 "$srcdir/vtwheel" "$pkgdir/usr/lib/urxvt/perl/vtwheel"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/vtwheel b/vtwheel
new file mode 100644
index 000000000000..08686f2b8b6a
--- /dev/null
+++ b/vtwheel
@@ -0,0 +1,47 @@
+#! perl
+
+# Implements a scrollwheel just like in good old vt100's mices
+
+sub simulate_keypress {
+ my ($self, $type) = @_; #type: 0:up, 1:down
+
+ my $keycode_up = 111;
+ my $keycode_down = 116;
+
+ my $numlines = 3;
+
+ my $keycode = 0;
+ if ($type eq 0) {
+ $keycode = $keycode_up;
+ } elsif ($type eq 1) {
+ $keycode = $keycode_down;
+ } else {
+ return;
+ }
+
+ for (my $i = 0 ; $i ne $numlines ; $i++) {
+ $self->key_press(0,$keycode);
+ $self->key_release(0,$keycode);
+ }
+}
+
+sub on_button_release {
+ my ($self, $event) = @_;
+
+ #my $res_ss = $self->resource("secondaryScroll");
+ #warn("ressource ss is <$res_ss>");
+
+ !$self->current_screen and return ();
+
+ #warn("foo, event: <$event->{button}>\n");
+ if ($event->{button} eq "4") { # scroll up
+ $self->simulate_keypress(0);
+ return 1;
+ } elsif ($event->{button} eq "5") { # scroll down
+ $self->simulate_keypress(1);
+ return 1;
+ }
+
+ return ();
+}
+