debian/0000755000000000000000000000000011703025325007164 5ustar debian/watch0000644000000000000000000000010211703025235010206 0ustar version=3 http://dl.bytesex.org/cvs-snapshots/input-(.*)\.tar\.gz debian/README.Debian0000644000000000000000000000053311703025304011223 0ustar input-utils for Debian ---------------------- The 'input-send' daemon which sends input events to other hosts over the network has been omitted from the package since it is probably not as useful as the other utilities. The same goes for the associated 'input-recv' program. -- Marcus Better , Tue, 10 Jan 2012 11:39:02 +0100 debian/rules0000755000000000000000000000022111703025235010237 0ustar #!/usr/bin/make -f -include /usr/share/quilt/quilt.make -include /usr/share/topgit/tg2quilt.mk export STRIP = export prefix = /usr %: dh $@ debian/source/0000755000000000000000000000000011703025235010464 5ustar debian/source/format0000644000000000000000000000001411703025235011672 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000211703025235010362 0ustar 8 debian/copyright0000644000000000000000000000220311703025235011114 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: input-utils Maintainer: Gerd Knorr Source: http://dl.bytesex.org/cvs-snapshots/ Copyright: 2004-2008 Gerd Knorr Copyright: 2008 Guillem Jover License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. Files: debian/* Copyright: 2004-2012 Marcus Better License: GPL-2 debian/patches/0000755000000000000000000000000011703025347010617 5ustar debian/patches/series0000644000000000000000000000047011703025347012035 0ustar features/exclude-libm.diff -p1 features/stdout-not-stderr.diff -p1 debian/remove-input-send-recv.diff -p1 features/fix-input-events-manpage-title.diff -p1 features/fix-kbdmap-off-by-one.diff -p1 features/lsinput-ignore-gaps.diff -p1 features/show-numeric-key-values.diff -p1 features/use-system-input.h.diff -p1 debian/patches/debian/0000755000000000000000000000000011703025325012035 5ustar debian/patches/debian/remove-input-send-recv.diff0000644000000000000000000000222411703025325017205 0ustar From: Marcus Better Subject: do not build input-send and input-recv These programs have limited usefulness and have been left out. --- GNUmakefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 73bae9d..947e015 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,7 +6,7 @@ include mk/Variables.mk CFLAGS += -DVERSION='"$(VERSION)"' # build -TARGETS := lsinput input-events input-kbd input-send input-recv lircd.conf +TARGETS := lsinput input-events input-kbd lircd.conf HEADERS := EV.h REL.h ABS.h MSC.h LED.h SND.h REP.h KEY.h BTN.h BUS.h SW.h # default target @@ -44,7 +44,7 @@ input.o: input.c $(HEADERS) install: build $(INSTALL_DIR) $(bindir) $(mandir)/man8 - $(INSTALL_BINARY) lsinput input-events input-kbd input-send input-recv $(bindir) + $(INSTALL_BINARY) lsinput input-events input-kbd $(bindir) $(INSTALL_DATA) lsinput.man $(mandir)/man8/lsinput.8 $(INSTALL_DATA) input-kbd.man $(mandir)/man8/input-kbd.8 $(INSTALL_DATA) input-events.man $(mandir)/man8/input-events.8 -- tg: (a20db48..) debian/remove-input-send-recv (depends on: master features/exclude-libm) debian/patches/features/0000755000000000000000000000000011703025325012431 5ustar debian/patches/features/fix-kbdmap-off-by-one.diff0000644000000000000000000000123611703025325017246 0ustar From: Marcus Better Subject: fix off-by-one error in input-kbd Bug-Debian: http://bugs.debian.org/388677 Forwarded: no Signed-off-by: Marcus Better --- input-kbd.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/input-kbd.c b/input-kbd.c index aaf23b9..6825ea9 100644 --- a/input-kbd.c +++ b/input-kbd.c @@ -50,7 +50,6 @@ static struct kbd_map* kbd_map_read(int fd, unsigned int version) entry.keycode = KEY_RESERVED; rc = ioctl(fd, EVIOCGKEYCODE, &entry); if (rc < 0) { - map->size--; break; } } else { -- tg: (cccd7bf..) features/fix-kbdmap-off-by-one (depends on: master) debian/patches/features/fix-input-events-manpage-title.diff0000644000000000000000000000123211703025325021233 0ustar From: Marcus Better Subject: fix incorrect man page title for input-events Bug-Debian: http://bugs.debian.org/413703 Forwarded: no --- input-events.man | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/input-events.man b/input-events.man index da381c7..0a23cad 100644 --- a/input-events.man +++ b/input-events.man @@ -1,7 +1,7 @@ .TH INPUT-EVENTS 8 "July 2005" "" "" .SH NAME -input-events \- list input devices +input-events \- print input events .SH SYNOPSIS \fBinput\-events \fR [\fB\-t\fR\ \fIsec\fR] [\fB\-g\fR]\ \fIdevnr\fR -- tg: (28d1d45..) features/fix-input-events-manpage-title (depends on: upstream) debian/patches/features/stdout-not-stderr.diff0000644000000000000000000001554711703025325016720 0ustar From: Steve Langasek Subject: informational messages should go to stdout, only errors to stderr --- input-events.c | 10 +++++----- input-kbd.c | 16 ++++++++-------- input-recv.c | 2 +- input-send.c | 4 ++-- input.c | 28 ++++++++++++++-------------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/input-events.c b/input-events.c index c525757..5ddb480 100644 --- a/input-events.c +++ b/input-events.c @@ -29,10 +29,10 @@ static void show_events(int nr, int timeout, int grab) close(fd); return; } - fprintf(stderr,"grabbed input device\n"); + printf("grabbed input device\n"); } - fprintf(stderr,"waiting for events\n"); + printf("waiting for events\n"); quit = 0; for (;;) { /* wait for input */ @@ -46,7 +46,7 @@ static void show_events(int nr, int timeout, int grab) quit = 1; break; case 0: - fprintf(stderr,"timeout, quitting\n"); + printf("timeout, quitting\n"); quit = 1; break; } @@ -61,7 +61,7 @@ static void show_events(int nr, int timeout, int grab) quit = 1; break; case 0: - fprintf(stderr,"EOF\n"); + printf("EOF\n"); quit = 1; break; default: @@ -79,7 +79,7 @@ static void show_events(int nr, int timeout, int grab) close(fd); return; } - fprintf(stderr,"released input device\n"); + printf("released input device\n"); } close(fd); } diff --git a/input-kbd.c b/input-kbd.c index aaf23b9..368b1aa 100644 --- a/input-kbd.c +++ b/input-kbd.c @@ -80,7 +80,7 @@ static struct kbd_map* kbd_map_read(int fd, unsigned int version) map->keys++; } if (map->keys) { - fprintf(stderr,"map: %d keys, size: %d/%d\n", + printf("map: %d keys, size: %d/%d\n", map->keys, map->size, map->alloc); return map; } else { @@ -96,7 +96,7 @@ static int kbd_map_write(int fh, struct kbd_map *map) for (i = 0; i < map->size; i++) { rc = ioctl(fh, EVIOCSKEYCODE, &map->map[i]); if (0 != rc) { - fprintf(stderr,"ioctl EVIOCSKEYCODE(%d,%d): %s\n", + printf("ioctl EVIOCSKEYCODE(%d,%d): %s\n", map->map[i].scancode,map->map[i].keycode, strerror(errno)); return -1; @@ -159,8 +159,8 @@ static int kbd_map_parse(FILE *fp, struct kbd_map *map) else entry.keycode = i; - fprintf(stderr,"set: "); - kbd_key_print(stderr,entry.scancode,entry.keycode); + printf("set: "); + kbd_key_print(stdout,entry.scancode,entry.keycode); map->map[entry.scancode] = entry; } return 0; @@ -180,9 +180,9 @@ static void kbd_print_bits(int fd) if (!test_bit(bit,bits)) continue; if (EV_TYPE_NAME[EV_KEY][bit]) { - fprintf(stderr,"bits: %s\n", EV_TYPE_NAME[EV_KEY][bit]); + printf("bits: %s\n", EV_TYPE_NAME[EV_KEY][bit]); } else { - fprintf(stderr,"bits: unknown [%d]\n", bit); + printf("bits: unknown [%d]\n", bit); } } } @@ -207,7 +207,7 @@ static int set_kbd(int fd, unsigned int protocol_version, char *mapfile) map = kbd_map_read(fd, protocol_version); if (NULL == map) { - fprintf(stderr,"device has no map\n"); + printf("device has no map\n"); close(fd); return -1; } @@ -217,7 +217,7 @@ static int set_kbd(int fd, unsigned int protocol_version, char *mapfile) else { fp = fopen(mapfile,"r"); if (NULL == fp) { - fprintf(stderr,"open %s: %s\n",mapfile,strerror(errno)); + printf("open %s: %s\n",mapfile,strerror(errno)); close(fd); return -1; } diff --git a/input-recv.c b/input-recv.c index 4a59f3c..527fc0f 100644 --- a/input-recv.c +++ b/input-recv.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) rc = read(sock,&ev,sizeof(ev)); if (rc != sizeof(ev)) { - fprintf(stderr,"read ret=%d (expected %d), errno=%s\n", + printf("read ret=%d (expected %d), errno=%s\n", rc,(int)sizeof(ev),strerror(errno)); exit(1); } diff --git a/input-send.c b/input-send.c index 0c26641..4e3af6c 100644 --- a/input-send.c +++ b/input-send.c @@ -44,7 +44,7 @@ static void conn_new(void) conn->peerhost,INET6_ADDRSTRLEN, conn->peerserv,32, NI_NUMERICHOST | NI_NUMERICSERV); - fprintf(stderr,"connect from [%s]\n",conn->peerhost); + printf("connect from [%s]\n",conn->peerhost); } fcntl(conn->socket,F_SETFL,O_NONBLOCK); @@ -55,7 +55,7 @@ static void conn_new(void) static void conn_del(struct connection *conn) { if (tcp_verbose) - fprintf(stderr,"connection from [%s] closed\n",conn->peerhost); + printf("connection from [%s] closed\n",conn->peerhost); close(conn->socket); list_del(&conn->list); free(conn); diff --git a/input.c b/input.c index d2e3ab2..ba9565d 100644 --- a/input.c +++ b/input.c @@ -94,7 +94,7 @@ int device_open(int nr, int verbose) return -1; } if (verbose) - fprintf(stderr,"%s\n",filename); + printf("%s\n",filename); return fd; } @@ -108,7 +108,7 @@ void device_info(int fd) rc = ioctl(fd,EVIOCGID,&id); if (rc >= 0) - fprintf(stderr, + printf( " bustype : %s\n" " vendor : 0x%x\n" " product : 0x%x\n" @@ -117,23 +117,23 @@ void device_info(int fd) id.vendor, id.product, id.version); rc = ioctl(fd,EVIOCGNAME(sizeof(buf)),buf); if (rc >= 0) - fprintf(stderr," name : \"%.*s\"\n",rc,buf); + printf(" name : \"%.*s\"\n",rc,buf); rc = ioctl(fd,EVIOCGPHYS(sizeof(buf)),buf); if (rc >= 0) - fprintf(stderr," phys : \"%.*s\"\n",rc,buf); + printf(" phys : \"%.*s\"\n",rc,buf); rc = ioctl(fd,EVIOCGUNIQ(sizeof(buf)),buf); if (rc >= 0) - fprintf(stderr," uniq : \"%.*s\"\n",rc,buf); + printf(" uniq : \"%.*s\"\n",rc,buf); rc = ioctl(fd,EVIOCGBIT(0,sizeof(bits)),bits); if (rc >= 0) { - fprintf(stderr," bits ev :"); + printf(" bits ev :"); for (bit = 0; bit < rc*8 && bit < EV_MAX; bit++) { if (test_bit(bit,bits)) - fprintf(stderr," %s", EV_NAME[bit]); + printf(" %s", EV_NAME[bit]); } - fprintf(stderr,"\n"); + printf("\n"); } - fprintf(stderr,"\n"); + printf("\n"); } /* ------------------------------------------------------------------ */ @@ -145,11 +145,11 @@ void print_event(struct input_event *event) t = event->time.tv_sec; strftime(ts,sizeof(ts),"%H:%M:%S",localtime(&t)); - fprintf(stderr,"%s.%06ld: %s",ts,event->time.tv_usec, + printf("%s.%06ld: %s",ts,event->time.tv_usec, EV_NAME[event->type]); switch (event->type) { case EV_KEY: - fprintf(stderr," %s %s", + printf(" %s %s", ev_type_name(EV_KEY, event->code), event->value ? "pressed" : "released"); break; @@ -160,14 +160,14 @@ void print_event(struct input_event *event) case EV_SND: case EV_REP: case EV_SW: - fprintf(stderr," %s %d", + printf(" %s %d", ev_type_name(event->type, event->code), event->value); break; default: - fprintf(stderr," code=%u value=%d", + printf(" code=%u value=%d", (unsigned int)event->code, event->value); } - fprintf(stderr,"\n"); + printf("\n"); } /* --------------------------------------------------------------------- -- tg: (cccd7bf..) features/stdout-not-stderr (depends on: master) debian/patches/features/show-numeric-key-values.diff0000644000000000000000000000133411703025325017767 0ustar From: Steve Langasek Subject: output the numeric value for keycodes in addition to the symbolic name Forwarded: no --- input.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/input.c b/input.c index ba9565d..9fc6963 100644 --- a/input.c +++ b/input.c @@ -149,8 +149,8 @@ void print_event(struct input_event *event) EV_NAME[event->type]); switch (event->type) { case EV_KEY: - printf(" %s %s", - ev_type_name(EV_KEY, event->code), + printf(" %s (0x%x) %s", + ev_type_name(EV_KEY, event->code), event->code, event->value ? "pressed" : "released"); break; case EV_REL: -- tg: (ef249de..) features/show-numeric-key-values (depends on: features/stdout-not-stderr) debian/patches/features/exclude-libm.diff0000644000000000000000000000112011703025325015627 0ustar From: Marcus Better Subject: do not link against libm libm is not needed for the build, so avoid unnecessary reference. --- GNUmakefile | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 32845c5..73bae9d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,7 +4,6 @@ include mk/Variables.mk # add our flags + libs CFLAGS += -DVERSION='"$(VERSION)"' -LDLIBS += -lm # build TARGETS := lsinput input-events input-kbd input-send input-recv lircd.conf -- tg: (28d1d45..) features/exclude-libm (depends on: upstream) debian/patches/features/lsinput-ignore-gaps.diff0000644000000000000000000000245411703025325017177 0ustar From: Tom Lear Subject: ignore gaps in the input device numbering Bug-Debian: http://bugs.debian.org/326149 Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=132;filename=lsinput.diff;att=1;bug=326149 Forwarded: yes --- lsinput.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lsinput.c b/lsinput.c index 45f50e5..b500d03 100644 --- a/lsinput.c +++ b/lsinput.c @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -10,14 +11,19 @@ static void list_devices(void) { int i,fd; + char filename[32]; + struct stat statbuf; for (i = 0; i < 32; i++) { - /* try to open */ - fd = device_open(i,1); - if (-1 == fd) - return; - device_info(fd); - close(fd); + snprintf(filename,sizeof(filename), "/dev/input/event%d",i); + if (stat(filename, &statbuf) == 0) { + /* try to open */ + fd = device_open(i,1); + if (-1 == fd) + return; + device_info(fd); + close(fd); + } } return; } -- tg: (28d1d45..) features/lsinput-ignore-gaps (depends on: upstream) debian/patches/features/use-system-input.h.diff0000644000000000000000000000234511703025325016770 0ustar From: Marcus Better Subject: use up-to-date input.h from linux-libc-dev Bug-Debian: http://bugs.debian.org/447550 Forwarded: not-needed Signed-off-by: Marcus Better --- input.h | 2 +- lirc.sh | 2 +- name.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/input.h b/input.h index 0abdc8a..0576490 100644 --- a/input.h +++ b/input.h @@ -1,7 +1,7 @@ #include #include -#include "linux-input.h" +#include #define ev_name(code) ((code) < EV_MAX && EV_NAME[code] ? EV_NAME[code] : "???") #define ev_type_name(type, code) ((code) < EV_TYPE_MAX[type] && EV_TYPE_NAME[type][code] ? EV_TYPE_NAME[type][code] : "???") diff --git a/lirc.sh b/lirc.sh index 74a6169..2aec1fd 100755 --- a/lirc.sh +++ b/lirc.sh @@ -1,5 +1,5 @@ #!/bin/sh -INPUT="linux-input.h" +INPUT="/usr/include/linux/input.h" cat < Sun, 08 Jan 2012 21:16:50 +0100 input-utils (0.0.20081014-1) unstable; urgency=low [ Steve Langasek ] * debian/patches/show-numeric-key-values: always output the numeric value for keycodes in addition to the symbolic name * debian/control: Vcs-Browser, not Vcs-Browse. * debian/patches/stdout-not-stderr: informational messages should always go to stdout by convention, only errors to stderr. LP: #307513. [ Marcus Better ] * New upstream version. * debian/rules: convert to debhelper 7. * debian/control: bump Standards-Version to 3.9.1 (no changes). * Switch to dpkg-source 3.0 (quilt) format * debian/copyright: DEP-5 copyright format. * DEP-3 patch format. -- Marcus Better Mon, 02 Aug 2010 22:16:30 +0200 input-utils (0.0.20051128-4) unstable; urgency=low * Use linux/input.h provided by linux-libc-dev instead of bundled copy. Thanks to Arjan Opmeer. Closes: #447550. -- Marcus Better Mon, 29 Oct 2007 16:44:29 +0100 input-utils (0.0.20051128-3) unstable; urgency=low * Honour the nostrip build option. Closes: #437208. -- Marcus Better Thu, 20 Sep 2007 21:33:22 +0200 input-utils (0.0.20051128-2) unstable; urgency=low * Corrected the title of the manual page for input-events. Closes: #413703. -- Marcus Better Sun, 22 Apr 2007 15:51:47 +0200 input-utils (0.0.20051128-1) unstable; urgency=low * New upstream version. * debian/compat: Bumped level to 5. * input-kbd.c: Fix off-by-one error when reading keymaps. Thanks to David Härdeman. Closes: #388677. * debian/rules: Clean up. -- Marcus Better Fri, 22 Sep 2006 10:41:35 +0200 input-utils (0.0.20050727-2) unstable; urgency=low * Bumped compat level to 5 and Standards-Version to 3.7.2. * Allow for gaps in /dev/input/eventXX numbering. Closes: #326149. Thanks to Tom Lear for the patch. * Use quilt to manage patches. -- Marcus Better Mon, 10 Jul 2006 08:04:01 +0200 input-utils (0.0.20050727-1) unstable; urgency=low * New upstream release. * Initial upload to Debian. Closes: #321966. -- Marcus Better Thu, 28 Jul 2005 13:52:46 +0200 input-utils (0.0.20050714-1) unstable; urgency=low * New upstream release. -- Marcus Better Tue, 26 Jul 2005 16:00:22 +0200 input-utils (0.0.20040421-1) unstable; urgency=low * Initial release. -- Marcus Better Mon, 11 Jul 2005 16:08:18 +0200 debian/examples0000644000000000000000000000001311703025235010717 0ustar lircd.conf debian/control0000644000000000000000000000136511703025304010571 0ustar Source: input-utils Section: utils Priority: optional Maintainer: Marcus Better Build-Depends: debhelper (>= 8), quilt (>= 0.46-7), linux-libc-dev Standards-Version: 3.9.2 Vcs-Git: git://git.debian.org/collab-maint/input-utils.git Vcs-Browser: http://git.debian.org/?p=collab-maint/input-utils.git Package: input-utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: utilities for the input layer of the Linux kernel This is a collection of utilities which are useful when working with the input layer of the Linux kernel (version 2.6 and later). Included are utilities to list the input devices known to the kernel, show the input events that are received by a device, and query or modify keyboard maps.